TIFF Image gets inverted - reproducible
Posted: 2007-07-20T17:55:57-07:00
I'm trying to work with this US post office image file.: https://boxaroo.com/www-pub/out.tif
I'm using the PHP front end to IM.
Whenever I export this file, it ends up inverted.
I'm using IM 6.3.3
One clue is, the original file looks normal in some things (Mac 'Preview') but in Firefox for example the background is yellow. I saw hints of the intercacies of TIFFs on the web but got lost.
BTW, I'm loading in as a blob because in the real system I get the image as a chunk in memory, not a file.
Help!! Thanks!
(sample program)
I'm using the PHP front end to IM.
Whenever I export this file, it ends up inverted.
I'm using IM 6.3.3
One clue is, the original file looks normal in some things (Mac 'Preview') but in Firefox for example the background is yellow. I saw hints of the intercacies of TIFFs on the web but got lost.
BTW, I'm loading in as a blob because in the real system I get the image as a chunk in memory, not a file.
Help!! Thanks!
(sample program)
Code: Select all
<?
$file_in = "out.tif";
$file_out = "out.gif";
$f = fopen($file_in, "rb");
$blob = fread($f, filesize($file_in));
fclose($f);
$im = NewMagickWand();
$result = MagickReadImageBlob($im, $blob);
if ($result) { echo "works";} else { echo "nope"; exit;}
// messed with these parms per some posts, had no effect
MagickSetImageOption($im, "tiff", "photometric", "min-is-black");
MagickSetImageOption($im, "tiff", "alpha", "unassociated");
$result = MagickWriteImage($im, $file_out);
if ($result) { echo "works";} else { echo "nope"; exit;}
?>