Page 1 of 1

Splitting multipage TIFF, image%03d.png does not work

Posted: 2010-02-09T08:05:48-07:00
by rproessler
Hello

I want to replace the pretty good working perl system command:

Code: Select all

system("convert $workdir/$tiff $tmpdir/$file%d.tif");
with a routine that let me keep the splitted pages for further processing in memory, in a string or an array.
But what ever I tried, I have only the first page, second, third and so on, got lost.

Also this modified example from PerlMagick does not work for me:

Code: Select all

  $filename = "image%d.tif";
  open(IMAGE, ">$filename");
  $image->Write(file=>\*IMAGE, filename=>$filename);
  close(IMAGE);
Any hint, suggestion?

Kind Regards
RP

Re: Splitting multipage TIFF, image%03d.png does not work

Posted: 2010-02-09T11:09:55-07:00
by magick
Don't write to a file handle. Use this instead:
  • $exception = $image->Write( "image%d.tif" );

Re: Splitting multipage TIFF, image%03d.png does not work

Posted: 2010-02-10T06:14:05-07:00
by rproessler
magick wrote:Don't write to a file handle. Use this instead:
  • $exception = $image->Write( "image%d.tif" );
Yes, it works.
Thank you.

RP