Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

Please sign in or apply for membership to remove the ads
    • CommentAuthorfreakingid
    • CommentTimeMay 23rd 2007
     
    One reason Plogger rules is because it is not bloatware, so I'm hesitant to mention this.
    But.
    It's the only lacking feature that has me saying "Oh, bummer."
    Has anyone given their Plogger installation the ability to rotate images and/or thumbnails after the images are uploaded?
    I mean, just in 90 degree increments.

    Plogger rocks.
    Paul Kaiser
    • CommentAuthornnemer
    • CommentTimeAug 17th 2007
     
    hello Paul,
    did you find a way to rotate an image after uploading, please?
    thanks,
    nicole
    • CommentAuthorbde
    • CommentTimeAug 19th 2007
     
    Hi folks,

    Any experiences to report on this? I would also love this feature.

    Thanks,
    Brian
    • CommentAuthorjammindice
    • CommentTimeAug 20th 2007 edited
     
    checking out the php manual or googling what you're looking for is always a good place to start.

    as it seems there is a built-in Image Rotate Function in php if you have the GD module installed (which you should if you are using plogger to begin with).

    Looks pretty simple, pass the filename and the degrees you want to rotate.

    It also looks like someone has written an image_rotate($degrees) function that you could use (if you scroll down to the comments section).

    give it a try and let us know what you did so future users can find this post.

    thanks
    • CommentAuthorjon
    • CommentTimeJun 20th 2008 edited
     
    If you want to auto rotate the image on upload based on orientation information in the EXIF data try the following patch (works for version 3.0 beta).

    Also in this patch is an alternative image_rotate function which works if you are using a separate GD module rather than the one bundled with PHP.

    Index: lib/phpthumb/phpthumb.class.php
    ===================================================================
    --- lib/phpthumb/phpthumb.class.php (revision 32)
    +++ lib/phpthumb/phpthumb.class.php (revision 33)
    @@ -44,7 +44,7 @@
    var $err = null; // default ERRor image filename
    var $xto = null; // extract eXif Thumbnail Only
    var $ra = null; // Rotate by Angle
    - var $ar = null; // Auto Rotate
    + var $ar = 'x'; // Auto Rotate
    var $aoe = null; // Allow Output Enlargement
    var $far = null; // Fixed Aspect Ratio
    var $iar = null; // Ignore Aspect Ratio
    @@ -928,8 +928,53 @@
    function Rotate() {
    if ($this->ra || $this->ar) {
    if (!function_exists('ImageRotate')) {
    - $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__);
    - return false;
    + // Code by Dominik Scholz: http://php.net/manual/en/function.imagerotate.php#82261
    + function imagerotate($src_img, $angle)
    + {
    + $src_x = imagesx($src_img);
    + $src_y = imagesy($src_img);
    + if ($angle == 180)
    + {
    + $dest_x = $src_x;
    + $dest_y = $src_y;
    + }
    + elseif (($angle == 90) || ($angle == 270))
    + {
    + $dest_x = $src_y;
    + $dest_y = $src_x;
    + }
    + else
    + {
    + return $src_img;
    + }
    +
    + $rotate=imagecreatetruecolor($dest_x,$dest_y);
    + imagealphablending($rotate, false);
    +
    + switch ($angle)
    + {
    + case 270:
    + $dest_x--;
    + for ($y = 0; $y < $src_y; $y++)
    + for ($x = 0; $x < $src_x; $x++)
    + imagesetpixel($rotate, $dest_x - $y, $x, imagecolorat($src_img, $x, $y));
    + break;
    + case 90:
    + $dest_y--;
    + for ($y = 0; $y < $src_y; $y++)
    + for ($x = 0; $x < $src_x; $x++)
    + imagesetpixel($rotate, $y, $dest_y - $x, imagecolorat($src_img, $x, $y));
    + break;
    + case 180:
    + $dest_x--;
    + $dest_y--;
    + for ($y = 0; $y < $src_y; $y++)
    + for ($x = 0; $x < $src_x; $x++)
    + imagesetpixel($rotate, $dest_x - $x, $dest_y - $y, imagecolorat($src_img, $x, $y));
    + break;
    + }
    + return $rotate;
    + }
    }
    if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) {
    $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__);
    @@ -2685,4 +2730,4 @@

    }
    • CommentAuthorMikeBC
    • CommentTimeOct 7th 2008
     
    I made this patch above but it looks like it is not self-implementing; that is, i made the change to phpthumb.class.php and there are no apparent changes to the way plogger operates. What additional changes are required to be able to use the rotate function?
  1.  
    MikeBC - did you ever find a solution? I'm seeing the same issue you did; I cannot get the rotate function patch outlined above to work during Import operations.