views:

2408

answers:

2

Hi all,

How can I convert a single jpg image into 3 different image format gif , png and bmp using PHP?

Pls help

+5  A: 
vartec
But its a huge library file, Could u pls help me for a perticular one?which code i have to use?
riad
+8  A: 

You first create an image object out of your file with imagecreatefromjpeg(). You then dump that object into different formats (using imagegif() for example):

$imageObject = imagecreatefromjpeg($imageFile);
imagegif($imageObject, $imageFile . '.gif');
imagepng($imageObject, $imageFile . '.png');
imagewbmp($imageObject, $imageFile . '.bmp');
soulmerge
thanks bro.its working properly.
riad
Note that WBMP is not the BMP as you might know it:http://en.wikipedia.org/wiki/Wbmp
Evert
great answer, exactly what i was lookking for too
Jeff Winkworth