Unable to Read image

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

Unable to Read image

Post by imtea »

Attempting to convert a tiff image to another format.

Operating System Version -> Sun Solaris 10 (Sparc - 64bit)
ImageMagick Version -> 6.3.4
PerlMagick Version -> 6.3.4

I was able to compile and install this on a Test server with GCC with relatively few problems. I now have to move this into a Production environment where GCC is not available. To enable this, I created a Sun Solaris package for both ImageMagick and PerlMagick. Both packages installed correctly. I have validated that the ImageMagick '.so' files are correctly linked via ldd.

Code: Select all

sub IMGINFO {
        print "Image: $img\n";
        print "II1\n";
        print LOG "Processing file: $img.....";
        $image = new Image::Magick;
        print "II2\n";
        $x_err = $image->Read("$img");
        warn "$x_err" if "$x_err";
        print "II3\n";
        ($h, $w) = $image->Get('height', 'width');
        ....
The image variable is being defined correctly. After the 'print "II2\n";' statement, the script just hangs and doesn't do anything. This same script works in the Test environment without a problem.

I set MAGICK_DEBUG=resource from the shell and invoked the script again. Here is the output:

Code: Select all

2008-03-06T14:11:03-05:00 0:01 0.140u 6.3.4 Resource PerlMagick[29302]: resource.c/unknown/418/Resource
  /var/tmp/magick-XX4kaWo5
Any assistance on this would be greatly appreciated, thank you.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Unable to Read image

Post by magick »

What does the tiffinfo program say about your TIFF image? What is its dimensions? Can you post a URL to your image so we can download and inspect it? Does the conversion work from the command-line:
  • convert -debug cache image.tif image.jpg
imtea

Re: Unable to Read image

Post by imtea »

magick wrote: What does the tiffinfo program say about your TIFF image? What is its dimensions? Can you post a URL to your image so we can download and inspect it? Does the conversion work from the command-line:

convert -debug cache image.tif image.jpg
PROD TIFFINFO OUTPUT:

Code: Select all

TIFF Directory at offset 0x48b0 (18608)
  Image Width: 2137 Image Length: 1521
  Resolution: 635, 635
  Bits/Sample: 1
  Compression Scheme: CCITT Group 4
  Photometric Interpretation: min-is-white
  Samples/Pixel: 1
  Planar Configuration: single image plane

PROD CONVERT OUTPUT: (GIF & JPG conversion) - Files created successfully.

Code: Select all

convert -debug cache 8085fafe.tif 8085fafe.gif
2008-03-06T14:33:38-05:00 0:01 0.010u 6.3.4 Cache convert[19998]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:33:38-05:00 0:01 0.020u 6.3.4 Cache convert[19998]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:33:38-05:00 0:01 0.020u 6.3.4 Cache convert[19998]: cache.c/unknown/3397/Cache
  open 8085fafe.tif[0] (anonymous memory, 2137x1521 24.7984mb)
2008-03-06T14:33:44-05:00 0:08 6.560u 6.3.4 Cache convert[19998]: cache.c/unknown/3397/Cache
  open 8085fafe.gif[0] (anonymous memory, 2137x1521 30.998mb)
2008-03-06T14:33:44-05:00 0:08 6.560u 6.3.4 Cache convert[19998]: cache.c/unknown/1779/Cache
  memory => memory
2008-03-06T14:33:50-05:00 0:13 12.130u 6.3.4 Cache convert[19998]: cache.c/unknown/2009/Cache
  destroy 8085fafe.gif[0]



convert -debug cache 8085fafe.tif 8085fafe.jpg
2008-03-06T14:34:51-05:00 0:01 0.010u 6.3.4 Cache convert[23788]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:34:51-05:00 0:01 0.020u 6.3.4 Cache convert[23788]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:34:51-05:00 0:01 0.020u 6.3.4 Cache convert[23788]: cache.c/unknown/3397/Cache
  open 8085fafe.tif[0] (anonymous memory, 2137x1521 24.7984mb)
2008-03-06T14:34:53-05:00 0:02 1.360u 6.3.4 Cache convert[23788]: cache.c/unknown/2009/Cache
  destroy 8085fafe.tif[0]


TEST TIFFINFO OUTPUT:

Code: Select all

TIFF Directory at offset 0x48b0 (18608)
  Image Width: 2137 Image Length: 1521
  Resolution: 635, 635
  Bits/Sample: 1
  Compression Scheme: CCITT Group 4
  Photometric Interpretation: min-is-white
  Samples/Pixel: 1
  Planar Configuration: single image plane

TEST CONVERT OUTPUT: (GIF & JPG conversion) - Files created successfully.

Code: Select all

convert -debug cache 8085fafe.tif 8085fafe.gif
2008-03-06T14:39:53-05:00 0:01 0.010u 6.3.4 Cache convert[9665]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:39:53-05:00 0:01 0.020u 6.3.4 Cache convert[9665]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:39:53-05:00 0:01 0.020u 6.3.4 Cache convert[9665]: cache.c/unknown/3397/Cache
  open 8085fafe.tif[0] (anonymous memory, 2137x1521 24.7984mb)
2008-03-06T14:40:00-05:00 0:08 6.870u 6.3.4 Cache convert[9665]: cache.c/unknown/3397/Cache
  open 8085fafe.gif[0] (anonymous memory, 2137x1521 30.998mb)
2008-03-06T14:40:00-05:00 0:08 6.870u 6.3.4 Cache convert[9665]: cache.c/unknown/1779/Cache
  memory => memory
2008-03-06T14:40:05-05:00 0:13 12.460u 6.3.4 Cache convert[9665]: cache.c/unknown/2009/Cache
  destroy 8085fafe.gif[0]



convert -debug cache 8085fafe.tif 8085fafe.jpg
2008-03-06T14:40:43-05:00 0:01 0.000u 6.3.4 Cache convert[12674]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:40:43-05:00 0:01 0.020u 6.3.4 Cache convert[12674]: cache.c/unknown/2009/Cache
  destroy
2008-03-06T14:40:43-05:00 0:01 0.020u 6.3.4 Cache convert[12674]: cache.c/unknown/3397/Cache
  open 8085fafe.tif[0] (anonymous memory, 2137x1521 24.7984mb)
2008-03-06T14:40:44-05:00 0:02 1.320u 6.3.4 Cache convert[12674]: cache.c/unknown/2009/Cache
  destroy 8085fafe.tif[0]
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Unable to Read image

Post by magick »

We're clueless why your PerlMagick script is hanging. We cannot reproduce the problem.
imtea

Re: Unable to Read image

Post by imtea »

Issue resolved, the PerlMagick was installed via the 'make install' and not through the Sun package that was created. Once the Sun package was applied, the images could be read and appear to be converting. Must be a final link that is created in the install process that could not be done since GCC does not exist on this server.

Thanks for the help.
Post Reply