• Hi there,

    I’ll start by saying thanks for this plugin! It’s simple and does what it suppose to do. I love that you kept it simple and clean.

    However, I can’t decide if this is a bug or if this is just a feature. But when I upload images and keeping the orientation the image is not oriented correctly. The orientation is lost. It does however seem to exist in exif. I’m currently using Imagick and according the the documentation the image isn’t automatically rotated when setting the orientation, which seems to be the problem for me.

    But if I replace the setOrientation part of your code with the following code, it works as I expect.

    
    // Add back $orientation if present.
    if ( $orientation ) {
      try {
        $imagick->setImageOrientation( $orientation );
        switch ($orientation) {
          case 8:
              $imagick->rotateimage("#000", -90);
              break;
          case 3:
              $imagick->rotateimage("#000", 180);
              break;
          case 6:
              $imagick->rotateimage("#000", 90);
              break;
        }
      } catch ( \Exception $e ) {
        self::logger( 'WP Strip Image Metadata: error while setting image orientation using Imagick: ' . $e->getMessage() );
      }
    }
    

    As I said, I’m not sure if this is another feature of if it’s a bug. But I think it would be better to automatically rotate the image. Maybe add it as an admin option?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Orientation and rotation’ is closed to new replies.