User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 429,897 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,422 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1373 | Replies: 5
Reply
Join Date: Apr 2008
Posts: 7
Reputation: conandor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
conandor conandor is offline Offline
Newbie Poster

how to convert bmp to jpg using php

  #1  
May 31st, 2008
anyone know how can i convert bmp to jpg using php?
ve play wif gf function but seem got work out
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: Oklahoma
Posts: 161
Reputation: ProfessorPC is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
ProfessorPC ProfessorPC is offline Offline
Junior Poster

Re: how to convert bmp to jpg using php

  #2  
May 31st, 2008
you can find the information and example (10th user post down by DHKold) here:
http://us3.php.net/imagecreate
Reply With Quote  
Join Date: Jul 2006
Location: Remunj
Posts: 216
Reputation: pritaeas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 27
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Posting Whiz in Training

Re: how to convert bmp to jpg using php

  #3  
Jun 2nd, 2008
In case you don't read all comments on that page, you need to have the GD extension installed.
Reply With Quote  
Join Date: Apr 2008
Posts: 7
Reputation: conandor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
conandor conandor is offline Offline
Newbie Poster

Re: how to convert bmp to jpg using php

  #4  
Jun 2nd, 2008
gd extension cant convert bmp to jpg, only wbmp to jpg
Reply With Quote  
Join Date: May 2008
Location: Kingdom of Saudi Arabia
Posts: 25
Reputation: yara1 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
yara1 yara1 is offline Offline
Light Poster

Re: how to convert bmp to jpg using php

  #5  
Jun 2nd, 2008
hi

imagejpeg($im,"pic.jpg");

try with this function
Reply With Quote  
Join Date: Apr 2008
Posts: 48
Reputation: helraizer is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
helraizer helraizer is offline Offline
Light Poster

Re: how to convert bmp to jpg using php

  #6  
Jun 2nd, 2008
Don't know why you would because jpg is a lot worse quality than png. If I were you convert to gif, but that's just me.

Convert to jpg:

  1. $image = ImageCreateFromPNG("yourimage.png");
  2.  
  3. header("Content-Type: image/jpg");
  4. ImageJpeg($image, "yourpngimage.jpg");
  5. ImageDestroy($image);

Convert to gif:

  1. $image = ImageCreateFromPNG("yourimage.png");
  2.  
  3. header("Content-Type: image/gif");
  4. ImageJpeg($image, "yourpngimage.gif");
  5. ImageDestroy($image);
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC