How to convert tiff into jpg through php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zenon
Forum Commoner
Posts: 42
Joined: Fri Jan 23, 2009 1:41 pm

How to convert tiff into jpg through php?

Post 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!
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: How to convert tiff into jpg through php?

Post 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).
Post Reply