How do I go about converting .bmp and .GIF to .jpg
What kinda PHP tricks can i do?
Convert image types
Moderator: General Moderators
- mrvanjohnson
- Forum Contributor
- Posts: 137
- Joined: Wed May 28, 2003 11:38 am
- Location: San Diego, CA
You could probably use GD to do this but I'm not sure if it can use BMP files. It can use WBMP files but I'm not sure if that's the same or not.
Anyway here's an example.......
......might be worth checking out GD if your not sure how to use it.
Anyway here's an example.......
Code: Select all
<?php
$im = imagecreatefromgif($theImage);
imagejpeg($im, "images/converted.jpeg", 100);
?>this app could work also...
http://www.imagemagick.org/
here's an example system command on a Linux server, the app is very powerful for image manipulation.
this converts pdf to jpg and to 150 dpi.
http://www.imagemagick.org/
here's an example system command on a Linux server, the app is very powerful for image manipulation.
this converts pdf to jpg and to 150 dpi.
Code: Select all
<?php
system("convert -density 150x150 pdf:$source jpg:$destination");
?>The server I run on has imagemagik, so ill give that a try. The whole thing to this is that users upload their picture, and if its a bmp or a gif then i can't throw it into my resize script, so i'll need to convert first. Im fairly new to php, my site is written in ASP, with one php script hopefully, this works out well.
A good place to start is http://us2.php.net/manual/en/ref.image.php. Make sure to look at the imagecreatefrom* functions as that is the first function you should use to convert an image.