Page 1 of 1

How to convert tiff into jpg through php?

Posted: Sat Feb 14, 2009 4:27 pm
by zenon
Hello.

I have some tiff images on a server and i want to convert them (php or html converting way) into jpg in order to show them in a browser.
I tried to install imagemagick but i didn't manage it. Is there any html script?
Is there any other "easy" way to convert them 'on the fly' while i ask the browser to show me the images?
I searched over the google for many many hours but unfortunately i didn't find anything!

I 'll m looking forward for your help!

Thank you!

Re: How to convert tiff into jpg through php?

Posted: Sat Feb 14, 2009 11:35 pm
by JAB Creations
What was the error you got when imagemagik did not work?

Doing a search on a search engine (:wink:) I would recommend trying this...

Code: Select all

<?php
$exec = "convert /path/to/file.tiff /path/to/file.jpg";
exec($exec, $yaks);
print_r($yaks);
?>
...or you can search more and if you post then add more details about what you tried and the errors you encountered. In fact when you encounter an error it's highly advisable to search the non-proprietary parts of the error message on a search engine (the proprietary parts being local url and such).