View Single Post
  #11  
Old 09-27-2005, 07:34 PM
jaywilliams's Avatar
jaywilliams+ Offline
Team Pixelpost
 
Join Date: Sep 2005
Posts: 1,003
Send a message via AIM to jaywilliams Send a message via MSN to jaywilliams Send a message via Yahoo to jaywilliams Send a message via Skype™ to jaywilliams
Lightbulb OK... got it working with EXIF

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($resizedimage0777);
    
chmod($resizedimage "_orig"0777);
    
exec("/home/...{path to jhead}.../admin/jhead -te " "./" $resizedimage "_orig " "./" .$resizedimage );
    
exec("rm " .  $resizedimage "_orig");
// End of EXIF fix
    
chmod($resizedimage0644);
    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
Reply With Quote