Hi
Jan gifsize fixed:
---
gifsize: func [
gif [file!]
/local x y data
][
data: read/binary gif
if none? find to-string ["GIF89a" "GIF87a"] copy/part data 6 [
make error! "Not a gif file"
]
x: data/7 + (256 * data/8)
y: data/9 + (256 * data/10)
return reduce [x y]
]
---
At 06:28 a.m. 27/03/00, you wrote:
> > Out of curiosity, has anyone written any Rebol/Core code that will
> > extract the dimensions of JPEG, GIF, and PNG files? I know this is more
> > the realm of Rebol/View, but it would be useful for Rebol/Core CGI
> > scripts too.
>
>Hi Eric.
>
>Here is the function returning x and y sizes of gif.
>
>gifsize: func [
> gif [file!]
> /local x y data
>][
> ;353x62
> data: read/binary gif
> if none? find to-string ["GIF89a" "GIF87a"] copy/part data 6 [
> make error! "Not a gif file"
> ]
> x: data/7 + (256 * data/8)
> y: data/9 + (256 * data/10)
> return [x y]
>]
>
>I hope this can be useful :-)
>
>Regards,
>Jan
--
Luis Marzulli
e-mail: [EMAIL PROTECTED]
Caracas, VENEZUELA
-------------------------------------------------------------
Get Paid For Every Email Message You Receive!
Get A Nickel For Every Email!
FREE membership... Start earning money right now, today!
Fun and Easy!
Just go to http://www.sendmoreinfo.com/id/605526