PDA

View Full Version : Image glyph problem



Anti-Distinctly
11-16-2008, 04:58 PM
Hi,
Finished writing an lscript that includes some image functionality, came to use it for it's intended purpose and the image file (as a glyph) is being loaded at half it's height. I'm completely clueless as to why this is happening as I really have no control over this. It should just be; load image > display image. I don't have any control over the size so I'm not sure what to do about it being messed up. The code I have is pretty much this:



//imageComboItems is an array containing image names loaded
imageComboOA = Image(imageComboItems[item]);
if(imageComboOA)
{
scene = Scene();
file = imageComboOA.filename( scene.currenttime * scene.fps );
imageGlyph = Glyph(file);
// imageGlyph.h is half of what it should be
info( string(imageGlyph.w) + ", " + string(imageGlyph.h) );
}


Every other image I've loaded has been fine. There's nothing particularly special about this image that I can think of. It loads fine in every other application, it's properties clearly states it's dimensions. Everything is consistent and correct apart from the image glyph.

Blochi
11-17-2008, 01:50 AM
Not sure entirely, I'm having a similar problem right now with Glyphs that insist on loading 1 pixel high (even though they're not...)

But in your script, maybe it works better when you create the Glyph directly from the Image Object. I believe I read somewhere that the $ sign come in handy for this. Like:


//imageComboItems is an array containing image names loaded
imageComboOA = Image(imageComboItems[item]);
if(imageComboOA)
{
imageGlyph = Glyph(string("$",imageComboOA.name));
// imageGlyph.h is half of what it should be
info( string(imageGlyph.w) + ", " + string(imageGlyph.h) );
}

Haven't tested this, probably buggy syntax.... but maybe worth a guess...

Anti-Distinctly
11-17-2008, 03:06 AM
I recall reading up about that too (not that I can find out where now). I tried it, the drawglyph function then complained about an invalid argument. I closed then reopened then requester to find that the image was there...still squashed.

This is very annoying, but this is the only image this has happened to so far...

Anti-Distinctly
11-17-2008, 05:44 AM
Fogged: 18445

Blochi
11-17-2008, 07:26 PM
oddly enough, my Glyph problem fixed itself by using another image, too.

Anti-Distinctly
11-19-2008, 02:45 AM
And fixed in 1504.
Nice :)