imported images smaller than 9 pixels sq
Jan Schenkel
janschenkel at yahoo.com
Thu Sep 25 07:03:01 EDT 2003
--- Martin Baxter <martin at harbourtown.co.uk> wrote:
> I've been using the example script from the docs to
> get image file
> dimensions. It's like this:
>
> lock screen -- so user doesn't see the following
> shenanigans
> lock error dialogs -- prevent error window if import
> fails
> import paint from file fname -- creates a new image
> unlock error dialogs
> put the width of last image into xwide
> put the height of last image into hhigh
> delete last image -- get rid of image we created
> unlock screen
> put xwide&","&hhigh
>
> Everything works fine until I use it on an image
> whose dimensions are < 9
> pixels in both dimensions, in which case xwide and
> hhigh get 120. Behaviour
> is the same for gif and jpeg files.
>
> It seems that the script reports the dimensions of
> an 8*8 pixel image (or
> smaller) as being 120*120 pixels, but the dimensions
> of an 8*9 pixel image
> (or larger) are reported correctly.
>
> Couldn't see anything like this in bugzilla, anybody
> else get this ?
>
> martin baxter
>
Hi Martin,
No need to bugzilla this ; it is caused by a
'newImage' handler higher up the message path, which
will automatically apply the default object size from
the preferences, if an image is smaller than 9x9
pixels.
So the easiest way to work around this feature, is to
trap the 'newImage' message yourself and not 'pass'
it.
Hope this helped,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
More information about the use-livecode
mailing list