got black screen after read a large size tif img

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

got black screen after read a large size tif img

Post by ycul »

The image size is > 16MB.. I am wondering if there is a file size limit for imagemagick.

I just tried to read and write a tif image, but the output image has just the top strip showing, them left are black acreen...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

A few days ago we converted a 1.2GB FITS image to TIFF without complaint. Make sure you are checking the status of any PerlMagick operation. For example, we've seen
  • $image->Read($filename);
Instead, check for the status with
  • $x = $image->Read ($filename);
    warn $x if "$x";
If a problem occurs it should print out with the warn statement.
ycul

still confused

Post by ycul »

what I have done:
........................................
$x = $image->Read("$ARGV[0]");
warn "$x" if "$x";
$x = $image->Write("new$ARGV[0]");
warn "$x" if "$x";
.............................................

The only warning msg I got:
Exception 350: 0002.tif: unknown field with tag 34686 (0x877e) encountered. `TIFFReadDirectory'
which can be ignored because some unknowd tags were found..

My files shinked from 3mb to 343kb, with black screen..
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick tries to cache large images to disk, typically /tmp. Your /tmp area may not have enough free space. Before you run your script, set the MAGICK_TMPDIR environment variable to a path with several gigabytes of free space. Assume /data:
  • export MAGICK_TMPDIR=/data
    perl magick.pl
If that fails, post a URL to your image so we can download and try to reproduce the problem.
Post Reply