Welcome Guest, Not a member yet? Register   Sign In
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");




Theme © iAndrew 2016 - Forum software by © MyBB