After taking a bit more of a look, and linking to another couple sites, I found a couple ideas for those of you who might want to try the imagerotate by EXIF feature. (Figured I'd start a new thread, because this is off-topic for the subalbums.)
Here's your imagerotate feature (possibly):
<?php
function imagerotate($src, $angle, $dummy) {
$width = imagesx($src);
$height = imagesy($src);
if ($angle == 90 || $angle == 270)
$dst = imagecreatetruecolor($height, $width);
else
$dst = imagecreatetruecolor($width, $height);
for ($y = 0 ; $y < $height ; $y++) {
for($x=0;$x<$width;$x++) {
switch ($angle) {
case 90:
imagecopy($dst, $src, $height-$y-1, $x, $x, $y, 1, 1);
break;
case 180:
imagecopy($dst, $src, $x, $y, $width-$x-1, $height-$y-1, 1, 1);
break;
case 270:
imagecopy($dst, $src, $y, $width-$x-1, $x, $y, 1, 1);
break;
default:
imagecopy($dst, $src, $x, $y, $x, $y, 1, 1);
}
}
}
imagedestroy($src);
return($dst);
}
?>
Looks like it could potentially plug right in to i.php.
Then, including an EXIF library, like:
http://www.ozhiker.com/electronics/pjmt/Which would in turn give you your capabilities (i think) to autorotate. Now i'm not a super-PHP expert. I can read code, and somewhat follow it, but if someone else look at these suggestions, they might be viable for inclusion into the zenphoto libraries. The code snippet above was culled from another image gallery called NAIG (not another image gallery). I don't advocate "stealing" the code, but it should give enough ideas as how to write an efficient function to handle autorotating from EXIF. I just don't know how myself.
Thinkdreams.
Comments
Is the assumption that this metadata can be used to manipulate pictures in zenphoto i.e. showing only pictures with ISO 400 or better, or sorting by date/time taken?
Thinkdreams
The patch is here:
http://www.zenphoto.org:8080/browse/ZEN-61
I'll try to add this back to the 1.0.3 version sometime soon so that others can try it out.
Thanks! This looks good.
Thanks!