0

How to dynamically Convert Tiff Images to jpeg using PHP, and Imagemagic .pls help as im new to php programming

HotSpot
  • 19
  • 2

1 Answers1

0

Imagemagick uses "convert" function for converting the image extension. As an example

convert rose.jpg rose.png

You have to call this command line method through a system call from your php page like,

system('convert rose.jpg rose.png');

Other options are available for destination/source location, resolution etc. Check this link for more details Imagemagick Convert Command

Sudip Pal
  • 2,041
  • 1
  • 13
  • 16
  • I look forward to asking your service to convert "`x.jpg; rm config.php`" – Joe Aug 02 '12 at 11:02
  • Something like this...so that when client uploads an image if its tiff then this cmd will be invoked converted and displayed. exec(convert inputFileDirectory/$inputfilename.tiff outputFileDirectory/$outputFilename.jpg); – HotSpot Aug 02 '12 at 11:49
  • yes, some minor points like.. 1. Check the imagemagick installed path, otherwise convert command will not work 2. use a quote when you pass the param in exec command. – Sudip Pal Aug 02 '12 at 11:52