Converting TIF to GIF produces all black image - Urgent Help

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
MPIIIMan

Converting TIF to GIF produces all black image - Urgent Help

Post by MPIIIMan »

Having a problem using MagickWand PHP extension.
When trying to convert some TIF to a GIF the end result comes out as a solid black box.

ImageMagick Version: 6.3.5-10 Q8 (9/15/07)
MagickWand PHP Extension: php-5.2.4_magickwand_q8_st.dll
OS: Windows Server 2003

Here is the code I am using.

Code: Select all

$MagickWand = NewMagickWand();
$readimage = MagickReadImage($MagickWand, "temp/74406.tif");
MagickSetImageFormat($MagickWand, "GIF");
MagickWriteImage($MagickWand, "extracts/74406.gif");				
Here is the file it produces
http://209.196.35.199/extracts/74406.gif

Here is the original file I am trying to convert.
http://209.196.35.199/temp/74406.tif

Please help :)
I'm stumped. Spent over 10 hours on this problem.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by magick »

Your TIFF image is corrupt so ImageMagick cannot read it.
MPIIIMan

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by MPIIIMan »

Thanks for the reply.

Is there any function I can use in MagickWand that will return that the image is corrupt.

I'm batch processing a bunch of images, and the script runs into these corrupt ones I have no way of knowing they were corrupt.
MPIIIMan

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by MPIIIMan »

Also if the TIF is corrupt, how come Photoshop can open it?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by magick »

Most likely Photoshop is more tolerant of errors. We use the libtiff delegate library and its reporting corruption to us. To investigate further you will need to post to the libtiff mailing list.
grepi

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by grepi »

Hello ImageMagick User,

I' m working on a macosx 10.5.7 system and have had just reinstalled ImageMagick:

i imagemagick 6.4.1-1013 Image manipulation tools
imagemagick-dev 6.1.8-1008 Image manipulation tools, oldest version
p imagemagick-nox [virtual package]
imagemagick-nox-dev 6.1.8-1008 Image manipulation tools, oldest version
imagemagick-nox-shlibs 6.1.8-1008 Image manipulation tools, oldest version
imagemagick-nox1-dev 6.4.1-1013 Image manipulation tools
imagemagick-nox10-dev 1:6.3.5-1017 Image manipulation tools, old version
imagemagick-nox10-shlibs 1:6.3.5-1017 Image manipulation tools, old version
imagemagick-shlibs 6.1.8-1008 Image manipulation tools, oldest version
imagemagick1-dev 6.4.1-1013 Image manipulation tools
i imagemagick1-shlibs 6.4.1-1013 Image manipulation tools
i imagemagick1-svg 6.4.1-1013 Image manipulation tools
imagemagick10-dev 1:6.3.5-1017 Image manipulation tools, old version
imagemagick10-shlibs 1:6.3.5-1017 Image manipulation tools, old version

convert:
6.4.1 01/29/09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC



rndr gears.rib makes Gearsx.tiff, x=1,2,3,4
convert Gears1.tiff Gears1.png : display Gears1.png : image OK
convert Gears1.png Gears1.pdf : black image
convert Gears1.tiff Gears1.pdf : black image

tiffinfo Gear1.tiff:
TIFF Directory at offset 0x2a0a8 (172200)
Image Width: 480 Image Length: 480
Resolution: 1, 1 (unitless)
Bits/Sample: 8
Sample Format: unsigned integer
Compression Scheme: LZW
Photometric Interpretation: RGB color
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 3
Planar Configuration: single image plane
Software: Pixie
MatrixWorldToScreen: 1.995447,-1.011418,0.237759,0.237759,-0.451741,-1.418443,-0.903482,-0.903482,-1.072726,-1.517127,0.356638,0.356638,21.029737,21.029734,42.059479,42.059479
MatrixWorldToCamera: 0.832050,0.501162,0.237759,0.000000,0.000000,0.428625,-0.903482,0.000000,-0.554700,0.751743,0.356638,0.000000,-0.000001,0.000003,42.059479,1.000000
Predictor: horizontal differencing 2 (0x2)

Something is rotten in ImageMagick, because inkscape via cairo can convert Gears.tiff to Gears1.pdf(pdf 1-4) : image OK.

Any hints

cheers,

grepi
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting TIF to GIF produces all black image - Urgent Help

Post by magick »

Post a URL to Gears.tif and Gears.pdf. We need to download the images and try to reproduce the problem before we can offer any help.
Post Reply