in reply to Image size in pure perl

Please, insert the /s in your REGEX, to tell that it's not multi line, or wont work if you have \r\n? in the data!

Your REGEX need to be:

if $_[0] =~ /^GIF8..(....)/s;

Note that width and height generally, like on BMP, are write in byte integer, in other words, they can have any type of byte, from 0 to 255.

For example, a BMP image with the width of 2570, has the byte integer as "\n\n\0\0".

Graciliano M. P.
"The creativity is the expression of the liberty".