in reply to TIFF Perl Module needed

You'll quite likely find nothing in pure Perl that deals with all the intricacies of TIFF, but you'll find many varieties which offer some limited exposure to the libtiff native C library. These are usually trying to homogenize the interfaces of many image formats at once.

Can you give more details about what you're trying to accomplish?

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: TIFF Perl Module needed
by monsieur_champs (Curate) on Jun 04, 2003 at 19:07 UTC

    Well, this is somewhat a long history... please be patient.

    I manage a fax web service, where folks can send faxes using the email.

    Its possible to receive faxes too. Faxes are received by a lower level mechanism and transformed into TIFF's. Those files suffer from a printing problem: when the sending fax don't separate pages, I receive a long page (usually containing the whole fax as a single image, with a very long lenght (in Y axis).

    As usual, my users don't know how to handle this kind of fax-transmittion-disfunction, and I need to resize / rotate / scale / crop images so they fit inside one or more A4 pages. Otherwise, 95% of my users are simply unable to print the faxes they receive.

    As my first approximation, I need just to crop the TIFF's so they can vertically fit into one or more A4 format pages. After this works, I will try to figure out how to make other transformations as needed.

    Could you please help me? I'm nearly desperate.

    May the gods bless you, fellow.

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Just Another Perl Monk

      This sounds eerily like a program I wrote for a client a few years ago (but no longer have access). I called it "the butcher." Trim the fat margins, find the best cutting strategy to give some overlap on each tiled page.

      That said, I'd have you look at ImageMagick, which has some support for the basic operations, and works very well with TIFF files. You may find you can script everything from the command line, or you may find the PerlMagick bindings to be useful.

      TIFF isn't the problem, it's just an implementation detail. The problem is deciding what to do with those big images to make them into something your users can use.

      --
      [ e d @ h a l l e y . c c ]

        First of all, congratulations for such a wise comment.

        In fact, I've tried to use PerlMagick's bindings, without a big success. My main troubles are:

        1. I don't know exactly what to do. This is my first time handling images in all my life, and this is strange to me yet;
        2. The PerlMagick Module trashes my processor. I think that this could be related to my poor image-handling strategy;
        3. I still have a BIG problem reading the resolution and the size of the image (in points) and determining what's the image size (in milimeters) so I can decide what to do with the image

        I can publish some code here, if you feel this useful. I didn't do that before because I want to annoy nobody with this.

        Thank you very much again, and may the gods bless you, fellow.

        =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        Just Another Perl Monk