Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Getting Imager to work with Activeperl

by NewRun (Novice)
on Oct 28, 2009 at 01:52 UTC ( #803552=note: print w/ replies, xml ) Need Help??


in reply to Re: Getting Imager to work with Activeperl
in thread Getting Imager to work with Activeperl

While I don't understand everything that this code does, it has worked wonderfully. Thank you.


Comment on Re^2: Getting Imager to work with Activeperl
Re^3: Getting Imager to work with Activeperl
by hangon (Deacon) on Oct 28, 2009 at 03:11 UTC

    You're welcome. The code was ripped out of a fax file manager project I wrote a while back. It doesn't make much sense without reading a copy of the TIFF specification, but in a nutshell the code traverses a chain of image directories (basically a linked list) using the while loop. Each image directory contains meta data and pointers for one image, so counting the directories gives you the number of images in the file. Each directory is also parsed for the pointer to the next image directory in the chain. Since TIFF files can be big or little endian, this is detected after the first read so the binary data can be properly unpacked.

    Note that the count too high detection is to prevent the possibility of a corrupt file causing an endless loop. It was arbitrarily set to 100, but a TIFF file can have any number of images, so set it to something sensible for your application.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://803552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-08-29 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls