Can iRev get the dimensions of an image?
Sivakatirswami
katir at hindu.org
Sat Nov 14 20:29:33 EST 2009
Sarah Reichelt wrote:
> On Sun, Nov 15, 2009 at 11:11 AM, Sivakatirswami <katir at hindu.org> wrote:
>
>> can the iRev engine get the dimension in width and height of an image file
>> on the web server?
>>
>
> Here is how I do it, using ImageMagick:
>
> -- Rev function that uses ImageMagick to get the dimensions of an image
> -- returns width,height
> --
> function picSize pPicPath
> -- ImageMagick command: identify pic.jpg
> -- returns: pic.jpg JPEG 640x480 DirectClass 87kb 0.050u 0:01
>
> put "identify " & pPicPath into tCmd
> put shell(tCmd) into tSize
> put word 3 of tSize into tSize
> replace "x" with comma in tSize
>
> return tSize
> end picSize
>
> Cheers,
> Sarah
> _______________________________________________
>
sweet -- it works here too. Thank you Sarah and all the other RunRev'ers
for being soooooo helpful!
[kt at sat image]# identify 01kanya_kumari.jpg
01kanya_kumari.jpg JPEG 480x320 480x320+0+0 8-bit DirectClass 14.6kb
[kt at sat image]#
More information about the use-livecode
mailing list