1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rotate 1.6

Easily rotate any attached image in a post.

  1. AndyB

    AndyB Well-Known Member

    AndyB submitted a new resource:

    Rotate - Easily rotate any attached image in a post.

    Read more about this resource...
     
  2. MARGO

    MARGO Member

    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
     
  3. Jake B.

    Jake B. Well-Known Member

    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 == 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: Nov 17, 2015
    otto, Digital Doctor and MARGO like this.
  4. AndyB

    AndyB Well-Known Member

  5. AndyB

    AndyB Well-Known Member

    MARGO likes this.
  6. otto

    otto Well-Known Member

    Hello Andy,

    Litle style "bug" :

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

    In your template, the phrase must be "rotate_rotate_clockwise" ;)
     
  7. otto

    otto Well-Known Member

  8. AndyB

    AndyB Well-Known Member

  9. karll

    karll Well-Known Member

    This add-on would be even more useful if one could additionally set the permissions so that a user could only rotate their own images.
     
  10. Robru

    Robru Active Member

    Not working for me with CDN.
     
  11. Blast

    Blast Active Member

    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: Dec 4, 2015
    StonePilot and AndyB like this.
  12. otto

    otto Well-Known Member

    No, here it works like it should for me.

    Have you uplaoded all files the correct way?
     
  13. StonePilot

    StonePilot Member

    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.
     
  14. Blast

    Blast Active Member

    I had to manually upload them in FTP and install via XML.
     
  15. Blast

    Blast Active Member

    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.
     
  16. Yodrak

    Yodrak Member

    @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
     
  17. Blast

    Blast Active Member

    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.
     
  18. otto

    otto Well-Known Member

    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. :)


    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)
     
  19. RobinHood

    RobinHood Well-Known Member

    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
     
    otto likes this.
  20. otto

    otto Well-Known Member

    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...
     

Share This Page