TIFF conversion with Image::Magick

J

Jesse Sheidlower

I've been sent some files in TIFF format, with each file
supposedly consisting of several hundred small images
in different "frames". Each file is about 750K or so.

First of all, I've tried to view these images in several
programs, including xloadimage, the GIMP, GQView, and
some others, and there's no indication that they contain
anything more than a single image.

Second, and Perl-related, I've tried to convert these to PNG
or some other format using Image::Magick, and it is not
working. I used a very simple test script, that works on
standard TIFF files, with the suggested approach of

$x = $img->Read('image_A.tiff');
warn $x if $x;

$x = $img->Write('image_A.png');
warn $x if $x;

but when I run this, after about 30 seconds of working, I get
a "Killed" response; it doesn't get to the first "warn" stage
at all, let alone give me the nice error messages the docs
promise. I get an identical response using "convert" on the
commandline. I've looked through Martien's book with no luck.

Any suggestions for converting these files? Optimally
I suppose I'd like to get each "frame" saved as a
separate file, but right now I'll settle for finding
out what's going on.

Thanks.

Jesse Sheidlower
 
M

Martien Verbruggen

[Note that none of this has anything at all to do with Perl, and is
only marginally related to the Image::Magick module. Maybe the
ImageMagick mailing list would be more appropriate]

\begin{offtopic}

I've been sent some files in TIFF format, with each file
supposedly consisting of several hundred small images
in different "frames". Each file is about 750K or so.

Where did these images come from? What created them?

There is no "single" TIFF format. There are many ways in which a TIFF
file can be organised, and not all of those ways are supported by all
software.

The overall TIFF format does support multiple images in one file, but
I certainly wouldn't count on widespread support for that.

On the other hand, Image::Magick should be able to create and read
multi-frame TIFF files. This might just be an odd format that confuses
it. Or maybe the file is corrupted?
First of all, I've tried to view these images in several
programs, including xloadimage, the GIMP, GQView, and
some others, and there's no indication that they contain
anything more than a single image.

Any other programs you tried? Is there any software that can confirm
that this TIFF format is indeed readable by something else than what
created it?
Second, and Perl-related, I've tried to convert these to PNG
or some other format using Image::Magick, and it is not
working. I used a very simple test script, that works on
standard TIFF files, with the suggested approach of

$x = $img->Read('image_A.tiff');
warn $x if $x;

$x = $img->Write('image_A.png');
warn $x if $x;

but when I run this, after about 30 seconds of working, I get
a "Killed" response; it doesn't get to the first "warn" stage
at all, let alone give me the nice error messages the docs
promise. I get an identical response using "convert" on the
commandline. I've looked through Martien's book with no luck.

(note that this is also not a Perl issue, but an ImageMagick issue)

That sounds to me like there is something not entirely clean with
those TIFF files, or that it's in some sort of format that
Image::Magick can't work with, but that looks like one that it thinks
it can work with.

If I were you, I'd send this to the ImageMagick mailing list, and
provide a link to one of those images, so people can have a look.
Any suggestions for converting these files? Optimally

Not without knowing anything more than that they are "TIFF files".

\end{offtopic}

Martien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top