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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
rproessler

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Don't write to a file handle. Use this instead:
  • $exception = $image->Write( "image%d.tif" );
rproessler

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

Post 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
Post Reply