I got the mod to work with EXIF now.
Here is what I did:
PHP Code:
function resizeimage($args) {
...
if ($ext == 'jpg' || $ext == 'jpeg') {
$img = @imagecreatefromjpeg($image_path);
} else if ($ext == 'png') {
$img = @imagecreatefrompng($image_path);
} else if ($ext == 'gif') {
$img = @imagecreatefromgif($image_path);
}
// Added:
// Creates a copy of the image with the the suffix _orig added to the end
exec("cp " . $image_path . " " . $image_path . "_orig");
echo "$image_path";
...
imagejpeg($img, "../images/$file");
$resizedimage = "../images/$file";
//Added:
// This makes the image writable, and then copies the EXIF data from the original image, then deletes the original.
chmod($resizedimage, 0777);
chmod($resizedimage . "_orig", 0777);
exec("/home/...{path to jhead}.../admin/jhead -te " . "./" . $resizedimage . "_orig " . "./" .$resizedimage );
exec("rm " . $resizedimage . "_orig");
// End of EXIF fix
chmod($resizedimage, 0644);
echo "$resizedimage";
}
Hope that helps.
I just downloaded the Pre-built Linux executable of Jhead, placed it in the ./admin/ directory, and set the chmod to 777.
Enjoy
- Jay