homepage Welcome to WebmasterWorld Guest from 54.161.246.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP: How to convert all image formats to JPG
sunroof

5+ Year Member



 
Msg#: 3802682 posted 5:26 pm on Dec 8, 2008 (gmt 0)

I'm tired of Googling. If anyone can help me with this I would really appreciate it.

Is there an easy way to convert all images (PNG, GIF, BMP,...) to simple JPG format using GD or MagickWand?

Something like this:

1) upload image001 (PNG, GIF, BMP,...)
2) check image format image001
3) convert to image001.jpg

Thanks a lot.

 

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3802682 posted 1:30 am on Dec 9, 2008 (gmt 0)

A quick G search results in many applications (outside of PHP) that do this task. I would try to take advantage of them using system() calls. They will probably be faster, too.

OutdoorWebcams

5+ Year Member



 
Msg#: 3802682 posted 10:42 am on Dec 10, 2008 (gmt 0)

When you have MagickWand installed, you also have ImageMagick installed, which comes with the very handy 'convert' command.

A simple system('convert /path/to/image001.BMP /path/to/image001.jpg') should do the trick.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved