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:
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)
 
Back
Top Bottom