well, you can't read any file without opening it (At least, at the OS level...) .gif files are binary data, so it tends to look like garbage if you're expecting something readable...
What are you expecting? Where does the CRC-16 come in? Are you just trying to get a checksum for a gif file, like to generate a list of duplicate images? you might try some MD5 routines, which will have a smaller chance of duplicate checksums (or "digests" as they're also called) for many files. If you're on a windows platform, set binmode FILEHANDLE to read the file properly.
Do you want to try to edit a gif file? You might try installing perlmagic.
If this still doesn't describe what you want, try the following template :
I would like to perform a/an( noun : operation or transformation) on a GIF file because I am trying to achieve ( noun : goal ). I have tried to ( list : things I have attempted), but they don't seem to work, because (list : results of attempts).
Update : Nits annoy me. changed template to work with nouns. | [reply] [d/l] |
| [reply] [d/l] |
There is no way to read a file without opening it.
To you, the contents of a .gif file may look like garbage.
But that is just because it was not intented to be read by a person
(its in binary).
Don't let the fact that you can't understand it (it looks like garbage to you)
lead you believe that it isn't good, usable data.
BTW, if you're processing a binary file on Windows, be sure to binmode it. | [reply] |
Type "binmode" in the search box to solve your problem. This will allow you to open and read binary files.
-THRAK
www.polarlava.com
| [reply] [d/l] |