Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #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
  #12  
Old 09-29-2005, 02:28 AM
brian connolly Offline
pp veteran
 
Join Date: Aug 2005
Posts: 59
chmod the jhead file... not the admin folder. my bad.

Works great!!!

Last edited by brian connolly; 10-06-2005 at 10:16 AM.
Reply With Quote
  #13  
Old 11-21-2005, 09:14 PM
yod Offline
forum loafer
 
Join Date: Nov 2005
Posts: 9
And without jhead

Hi Everybody.

First, I would like to thank utoks for his hack : it avoids me to do the job :-)

Is there a way to keep EXIF information without using jhead ? My web account doesn't support it, and I can't execute the linux binarie file.

If someone has an idea...

++
yod
the darkside photoblog
Reply With Quote
  #14  
Old 11-22-2005, 11:54 PM
utok Offline
pp regular
 
Join Date: Oct 2004
Posts: 26
ah so I see you've figured out the EXIF issue, jay. Im sorry i did not get back to you earlier.

I tried out your modification to the wallpaper mod. Im still not getting exif data on the resized images. but i have a feeling that is because exec() doesnt work on my server. I asked my <a href="lunarpages.com"> hosts</a> to switch me to an exec() enabled server so ill try it then.
(it should be noted that i applied your code to the 1.4.3 index file that i just updated to work with the wallpaper mod, however i doubt that would change anything)

Meanwhile- im going to include just the non exif modded index.php for 1.4.3 for the next release. Once they switch me to an exex() enabled server ill figure out the exif stuff and then release it.

Here is the new mod file for 1.4.3: http://www.pixelpost.org/v1/index.ph...ads&details=64
OR
http://jondrews.com/pixelpost_v1.4.3..._mod_utoks.zip

Thanks for working on this jay!

Last edited by utok; 11-23-2005 at 12:28 AM.
Reply With Quote
  #15  
Old 12-04-2005, 12:42 AM
utok Offline
pp regular
 
Join Date: Oct 2004
Posts: 26
yup it works. tight stuff jay williams. thanks!
Reply With Quote
  #16  
Old 12-24-2005, 02:54 PM
yod Offline
forum loafer
 
Join Date: Nov 2005
Posts: 9
Modified behaviour

Hi,

I changed a bit the behaviour of your mod, because of my EXIF problem. Now, it works like this :
- you post your picture, wallpaper sized.
- pixelpost resizes the picture at the display size
- You have now two versions of the picture : wallpaper and "normal" display.
- If there is no EXIF information inside the normal display picture, it will read the information inside the wallpaper picture.

Let me know if you are interested by the mod.

++
yod
Reply With Quote
  #17  
Old 01-05-2006, 02:33 AM
Madferret Offline
forum loafer
 
Join Date: Jan 2006
Posts: 1
Talking

Quote:
Originally Posted by yod
Hi,

I changed a bit the behaviour of your mod, because of my EXIF problem. Now, it works like this :
- you post your picture, wallpaper sized.
- pixelpost resizes the picture at the display size
- You have now two versions of the picture : wallpaper and "normal" display.
- If there is no EXIF information inside the normal display picture, it will read the information inside the wallpaper picture.

Let me know if you are interested by the mod.

++
yod

yod,

I'm interested in your mod.. that's a great workaround. Is there anywhere to download it or modify the script?

Thanks.
Reply With Quote
  #18  
Old 01-19-2006, 05:53 AM
utok Offline
pp regular
 
Join Date: Oct 2004
Posts: 26
i got a couple of requests to modify this for the new 1.5 pixelpost. im gonna wait until it goes full release. meanwhile -- raminia created a image resize mod for 1.5.

http://forum.pixelpost.org/showthread.php?t=2936
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 08:13 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs