Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://803552]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2018-06-22 11:06 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.