• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert all uploaded images to JPG?

#1
[eluser]Phil Sturgeon[/eluser]
Could have sworn I posted something on this, but apparently not. I am trying to force all uploaded images to be saved as JPG, but I want them to be able to upload GIF and PNG too. Therefore instead of just limiting what can be uploaded, I need to convert everything to JPG.

I tried extending the Image Manipulation class but it just breaks alot, its too confusing for poor little ill me. Can anyone lemme know how this can be done easily? Plain PHP is fine or a lib extention, whichever!

#2
[eluser]Michael Wales[/eluser]
Did you try the suggestion we discussed - but in plain PHP (rather than extending).

Use the Mime lib to determine file type, GD2 createfrom* method to create the image, then save as JPED using the GD2 methods?

I know you attempted this by extending the image lib - but give it a shot with straight PHP and see if it pans out.

Weren't you returning blank screens? Syntax error?

#3
[eluser]funkmyer[/eluser]
If you have imagemagick installed simply add this:

system("convert {$_FILES[0]['tmp_name']} /some/where/mynewimage.jpg");


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.