Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

ImageGallery rotate image bug


Reply

940 Views

Avatar
fabilo

8 September 2010 at 12:11pm Community Member, 10 Posts

I just worked through a random bug with the ImageGallery module. I'm not exactly sure what version it is, but it's a recent one. This may help someone else.

The bug appears when your in the admin backend, then clicking on an image in the "Photos" tab, then trying to rotate the image.
It looks like the bug only happens when you don't have your ss installation in the root dir, and therefore using .htaccess to reroute urls.

Firebug returns a 500 error like so:

ERROR [Warning]: copy(/Users/username/Clients/clientname/ss//domain.co.nz/ss/assets/image-gallery/Gallery/default-gallery/_resampled/rotateclockwise-016.jpg): failed to open stream: No such file or directory
IN GET /domain.co.nz/ss/ImageGalleryManager_Controller/rotateimage/24/cw?flush=1
Line 206 in /Users/username/Clients/client/htdocs/ss/image_gallery/code/ImageGalleryManager.php

I edited the working directory to hide client info etc.

Solution
To fix I edited the rotateimage() function in ImageGalleryManager.php & changed the line:

$url = $this->urlParams['OtherID'] == 'cw' ? $image->RotateClockwise()->URL : $image->RotateCounterClockwise()->URL;


to:

$url = $this->urlParams['OtherID'] == 'cw' ? $image->RotateClockwise()->Filename : $image->RotateCounterClockwise()->Filename;

This way the code only worries about the dir path from the root of the install, rather than the url etc.