Hi this is a bit of a wide question. I just started using Jpeg Reducer and it did not reduce so far.
Here si what I am trying to do:
For an upload feature, I upload a temp file , after the user submitted the upload, the file gets a name and is moved to the user's account folder.
When finally moving it to that folder, the last step is to compress the Jpeg in order to save space on the main server.
Yet checking the file size, its not compressed.
As far as I am aware, the server is running PHP5
Here is the code:
Code: Select all
<?php
require("class.jpegreducer.php");
// copies file to new location with new name and compresses
$sourcePath = $_GET['sourcePath'];
$targetPath = $_GET['targetPath'];
// copy file
copy($sourcePath, $targetPath);
// delete old one
unlink($sourcePath);
//
//
print "errorCode=1";
//
// COMPRESS FILE
$im = new JPEGReducer($targetPath,80000);
$im->OutputImage($targetPath);
//
print "errorCode=1";
?>Anyone any ideas?
I dont seem to get a error message from the code if I launch the code via browser (rather than calling it from flash as I am doing at the moment), the image is dislayd at the end of the process, which is probably part of the class functionality, yet no compression.
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: