![]() |
|
Can we rotate images? - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Can we rotate images? (/thread-2456.html) |
Can we rotate images? - rhondalicious - 2008-03-16 I'm sorry, but I've searched the forums here and haven't really found my answer... I think the auto-rotating would be awesome, but I'm patient and can wait for that. Zen Photo is almost perfect for my needs, except for my few photos that need rotating. Is there a place in the admin hiding a rotate feature? Is there a add on I can install that will just allow me to rotate an image 90 degrees either way? All I want is a gallery where people don't need to tilt their heads to see a photo! Can we rotate images? - sbillard - 2008-03-16 http://www.zenphoto.org/trac/ticket/111 Since there are only a few images, why not rotate them with a photo editing program and then upload them? Can we rotate images? - rhondalicious - 2008-03-16 Well, a few images scattered across dozens and dozens (more than a hundred) of folders - it's an archive of every single photograph I've taken over the last 6 years. I've already rotated many of them, but to sit and go through the folders to find them all would take forever - I guess I just want the ability to rotate a photo if I happen to notice that one is still oriented the wrong way. And I know the auto-rotate is coming, I was just hoping maybe someone had done an add-on or hack to give the ability to rotate a photo, perhaps from inside the gallery instead of in the admin. Thanks for your help! Can we rotate images? - williamz - 2008-04-21 Say how far along is this autorotate thing? I don't see it in the 1.1.6 trac and the above link is old indicating that imagemagick needs to be integrated beforehand and I don't see it in the trac either. So love to hear what is in the works so that I don't have to butcher the existing code to put something that sort of works.... Oh what's the reasoning behind the imagemagick? Sorry if this has already been addressed, I only started coding in php 30 mins ago because full_image.php didn't have the function to resize the full image regardless of how big the image and compress it. But after reading on the functions, php does have a imagerotate function and I know you have some sort of exif function already. So why the need for imagemagick? Can we rotate images? - sbillard - 2008-04-21 http://www.zenphoto.org/trac/search?q=rotation&wiki=on&changeset=on&ticket=on BTW, the reason full_image does not resize the image is because it is [b]FULL IMAGE[/b]. It wouldn't be a full image if it was resized, would it? imagerotate is a feature of PHP 4.3 and greater. We require version 4.1 or greater, so we cannot use this routine. Can we rotate images? - williamz - 2008-04-22 Yep I know but that's a custom thing I wanted so I made it myself for the full image download. Ok understood with the imagerotate. Looks like from your link it's going to be pushed ahead to milestone 1.2. So not anytime soon. Guess I'll have to work on patching the current version. I'm going to use imagerotate along with the native exif support in PHP 4.3 since I'm already at least that level. Thought it was going to be easy but I'm two hours into it and still trying to figure out what is called from where. I've already patched functions-image.php so that the result cache files are rotated. Now I have to figure out where the function calls are for the width and height of these images so the img src width and height tags are so they don't squish my images. Can we rotate images? - williamz - 2008-04-22 OK I think this works. I'm a sloppy coder and this is my first time with PHP so don't shoot me! If anyone's interested they can explore it more. Again this is the autorotate function and it leaves the original files intact. It requires PHP 4.3 and the php exif support enabled (it came installed with my fedora core 6 so I really didn't have to do anything). There's two files modified. First function is the [b]updateDimensions() in class-image.php[/b]. Not sure how many places it's called but this is where the width and height is called for the tag. If you don't do this you will have squishy images because it still thinks you have the landscape format. Second function is the [b]cacheGalleryImage() in function-image.php[/b]. This is where the imagerotate function is used to rotate the images for the cache images.
function cacheGalleryImage($newfilename, $imgfile, $args, $allow_watermark=false, $force_cache=false) {
Can we rotate images? - sbillard - 2008-04-22 Why don't you add this code to the ticket on image rotation. We might decide to use it and make the feature dependent on having PHP 4.3, at least until another solution is availabe. Best is to make the changes against the SVN or nightly build and post a patch file. If patch files are a problem, just post the modified class-image.php and function-image.php files. I may not get to this right away, I'm going to be in the Galapagos for a couple of weeks. Can we rotate images? - williamz - 2008-04-23 Ok I'll have to write something up. This isn't the most efficient code and I wouldn't want to see this code included in any builds! That's the last thing I want is for Zenphoto to be bogged down by my code Like I said this is just a hack for me. The call for the exif orientation is called in every page so it seems very inefficient to me. I would use the zp database information but I'm not sure how to call it and even so the data for EXIFOrientation is a string of words. So either the EXIF module in ZP has to be restructured or a compromise thought out. Can we rotate images? - vraa - 2008-05-09 I am not too proficient at coding Can we rotate images? - Noiseconformist - 2008-10-30 Hi there, sorry for opening this old can of worms ... ;-) from trac: I do agree, but wouldn't be the caching mechanism of some help here? Since you mentioned doing the rotation manually before uploading: My current workflow now even skips colour correction (colour space etc.) - so currently my pics literally go online from the SD-card (I share the photos with the curating team of a big festival going on here this weeks). Did I miss something or do I have to know anything before I start to incorporate the above code? (while not being a software specialist) Thanks a lot! Michael. Can we rotate images? - Noiseconformist - 2008-10-30 PS: @vraa vs. "The PHP development team hereby announces that support for PHP 4 will continue until the end of this year only. After 2007-12-31 there will be no more releases of PHP 4.4. We will continue to make critical security fixes available on a case-by-case basis until 2008-08-08. Please use the rest of this year to make your application suitable to run on PHP 5. " is not a bad thing! My provider runs php5 and MySQL 5 and (so far) I didn't experience any trouble here. Can we rotate images? - Noiseconformist - 2008-10-30 PPS: I just realised that the milestone for rotation is V 1.3 ... Can we rotate images? - Noiseconformist - 2008-10-30 ok, later I'll try to patch with this: But I'm not sure if this works with 1.2 by now? Can we rotate images? - Noiseconformist - 2008-11-05 I just sat down to apply the patch (manually) and noticed that the provided patch info doesn't match the 1.2.1 code I have installed. Can we rotate images? - Noiseconformist - 2008-11-07 Does it make sense to take the most recent nightly build? Can we rotate images? - sbillard - 2008-11-07 The nightly builds have not gone through extensive testing, so there may be new problems introduced in them. That said, they tend to be stable. So, generally I would recommend using the nightly builds when doing new implementation. That way you avoid having to do it twice. As to the production system. If you have tested the nightly build and it seems to work there is no reason not to use it for production. My site is using a nightly build in production. I don't upgrade it for each fix, but when there are things in the nightly that are improtant to the site the site goes to the nightly build. |