class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Yes, my mistake... If you use imagejpeg(), you need to have a PHP image resource as an argument. What the class returns is actually the content of the picture (in JPEG, or in PNG, depending on your settings when calling process()), and not a PHP ressource.
So to dump the image on file, you need to do something like this:
I don't have time to test but I reckon that is the issue. My apologies for the wrong code in my previous posts.
Note that instead of writing the image content to a file, you could output it to the browser. In this case again, it is not a PHP image resource that you output, but the actual content of the image in JPG:
Looking at the code of the class again, I should probably modify it so that you can have direct access to the image resource if you wish to pass it though imagejpeg() yourself.Reply
So to dump the image on file, you need to do something like this:
I don't have time to test but I reckon that is the issue. My apologies for the wrong code in my previous posts.
Note that instead of writing the image content to a file, you could output it to the browser. In this case again, it is not a PHP image resource that you output, but the actual content of the image in JPG:
Looking at the code of the class again, I should probably modify it so that you can have direct access to the image resource if you wish to pass it though imagejpeg() yourself.