Page 1 of 1

Can convert jpg but not tif

Posted: 2009-03-13T00:01:32-07:00
by benny
Can someone please tell me why it works to convert jpg files but not tif files. When I run this code on my webhost it creates logo1.jpg from logo.jpg But it will not create logo1.tif

The tif file is only 48K in size so it should not be a memory problem. My webhost is running
ImageMagick version 6.2.6
PHP imagick version 0.9.11

Strange...

Code: Select all

<?php

$exec = "/usr/bin/convert 'logo.jpg'  'logo1.jpg' $yaks ";
exec($exec, $yaks);
print_r ($yaks);

$exec = "/usr/bin/convert 'logo.tif'  'logo1.tif' $yaks ";
exec($exec, $yaks);
print_r ($yaks);
		
?>

Re: Can convert jpg but not tif

Posted: 2009-03-13T11:20:01-07:00
by fmw42
benny wrote:Can someone please tell me why it works to convert jpg files but not tif files. When I run this code on my webhost it creates logo1.jpg from logo.jpg But it will not create logo1.tif

The tif file is only 48K in size so it should not be a memory problem. My webhost is running
ImageMagick version 6.2.6
PHP imagick version 0.9.11

Strange...

Code: Select all

<?php

$exec = "/usr/bin/convert 'logo.jpg'  'logo1.jpg' $yaks ";
exec($exec, $yaks);
print_r ($yaks);

$exec = "/usr/bin/convert 'logo.tif'  'logo1.tif' $yaks ";
exec($exec, $yaks);
print_r ($yaks);
		
?>

Do you have libtif installed? You can see what image types you have installed by issuing the command,

convert -list configure

look at the line that starts with DELEGATES. For example, mine shows:

DELEGATES bzlib fontconfig freetype jpeg jp2 lcms lqr openexr png tiff x11 xml zlib

You can get the delegates at:
http://www.imagemagick.org/download/delegates/

Sorry I do not use PHP, so I cannot tell you how to do the equivalent in PHP. Hopefully someone like Bonzo will reply as he uses PHP regularly.