Rotate

Rotate 1.9

No permission to download

AndyB

Well-known member
AndyB submitted a new resource:

Rotate - Easily rotate any attached image in a post.

Description:

Easily rotate any attached image in a post.

Attached images sometime are uploaded in the incorrect orientation, until now this was difficult to fix. Now you simply click the Rotate link below the post and quickly rotate the attachment to the correct orientation.

(Example of Rotate link)

View attachment 121958

(Example of Rotate page)

View attachment 121959

(Example of Group Permissions)

View attachment 121960

Requirements:...

Read more about this resource...
 
Server Error
Invalid controller response from Andy_Rotate_ControllerPublic_Rotate::actionIndex

  1. XenForo_FrontController->_handleControllerResponse() in XenForo/FrontController.php at line 359
  2. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  3. XenForo_FrontController->run() in /var/www/sait/data/www/sait.ga/index.php at line 13
 
PHP:
if ($getOption != 'imPecl')
        {         
            XenForo_Error::logException(new XenForo_Exception("ImageMagick is not enabled."));
            return true;
        }
     
        // get options from Admin CP -> Options -> Attachments -> Maximum Attachment Image Dimensions
        $attachmentMaxWidth = XenForo_Application::get('options')->attachmentMaxDimensions['width']; 
     
        // get options from Admin CP -> Options -> Attachments -> Maximum Attachment Image Dimensions
        $attachmentMaxHeight = XenForo_Application::get('options')->attachmentMaxDimensions['height'];
     
        // verify maximum dimensions is set
        if (    $attachmentMaxWidth == '' OR $attachmentMaxWidth == 0 OR $attachmentMaxHeight == '' OR $attachmentMaxHeight == 0)
        {
            XenForo_Error::logException(new XenForo_Exception("Maximum Attachment Image Dimensions not set."));
            return true; 
        }

A controller shouldn't return true, it will cause errors. Try using $this->responseError as the return

Also:

PHP:
if ($direction == 'cc')
        {
            exec("/usr/bin/mogrify -rotate 90 $attachmentFullPath");
        }
     
        if ($direction == 'ccw')
        {
            exec("/usr/bin/mogrify -rotate -90 $attachmentFullPath");
        }
     
        if ($direction == '180')
        {
            exec("/usr/bin/mogrify -rotate 180 $attachmentFullPath");
        }

All of this can be done without using exec. Most servers won't have exec enabled.

See: http://php.net/manual/en/imagick.rotateimage.php

< Removed SQL injection vuln details >
 
Last edited by a moderator:
Hello Andy,

Litle style "bug" :

upload_2015-11-26_20-39-4.webp

In your template, the phrase must be "rotate_rotate_clockwise" ;)
 
Anyone else getting this error when trying to install?
Callback Andy_Rotate_Listener::post is invalid (Invalid Class).

EDIT: Solved. Andy was very quick to clear the issue.
 
Last edited:
No, here it works like it should for me.

Have you uplaoded all files the correct way?
 
Anyone else getting this error when trying to install?
Callback Andy_Rotate_Listener::post is invalid (Invalid Class).

EDIT: Solved. Andy was very quick to clear the issue.

What was the fix for issue? I'm getting this as well. I'll try to turn off all of Andy's plug-ins and see if that helps.
 
How can I achieve this?

I want the people to have access to the rotate button would be the person who posted the attachment and the staff members.
 
@AndyB

Hello Andy, i tried out your rotate function but it don´t work in my Site.
I can rotate the Picture but if i go back to the Post-Site and refresh nothing happen.
Do you have any Idea why i have this Problem?

Thanks
 
Is it possible to have the button only show up when there's a valid image attachment? It seems to show up in every post.
 
hmm... is that a good idea? Every new function costs a litle bit perfomance.

So, if it gives a eays good way, ok.
But if a new SQL action is to do, better not. :)


I want the people to have access to the rotate button would be the person who posted the attachment and the staff members.
If its possible - can you make a conditional around the code for the button?


I love this addon - it prevents my time and dont stress my members to become right rotated pictures in there posts. (y)
 
Not had a chance to test this yet - but love that you've made this Andy!

It's been one of my major gripes for a long time now. It's a very frustrating recurring issue when images posting from smartphones.

Would still like to see it integrated into the core. Suggestion here
 
I think the problem is, that many smartphones pictures auto rotate only on the smartphone that has make the photo. But if peopel share this pictures, they are not properly rotated. I see this often also in my WhatsApp groups, or on facebook and since a while also in my forums...
 
Back
Top Bottom