Make WordPress Core

Changeset 54265

Timestamp:
09/20/2022 04:57:15 PM (23 months ago)
Author:
antpb
Message:

Media: Respect EXIF Rotations.

Previously, the logic to determine EXIF rotation information was not providing the correct rotation. This patch respects the information properly by swapping some of the flip() logic on certain rotations.

Props tbember, SergeyBiryukov, costdev, mikeschroder, adamsilverstein.
Fixes #54937.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor.php

    r54226 r54265  
    513513            case 2:
    514514                // Flip horizontally.
    515                 $result = $this->flip( true, false );
     515                $result = $this->flip( e );
    516516                break;
    517517            case 3:
     
    522522            case 4:
    523523                // Flip vertically.
    524                 $result = $this->flip( false, true );
     524                $result = $this->flip( e );
    525525                break;
    526526            case 5:
     
    529529
    530530                if ( ! is_wp_error( $result ) ) {
    531                     $result = $this->flip( false, true );
     531                    $result = $this->flip( e );
    532532                }
    533533
     
    542542
    543543                if ( ! is_wp_error( $result ) ) {
    544                     $result = $this->flip( true, false );
     544                    $result = $this->flip( e );
    545545                }
    546546
Note: See TracChangeset for help on using the changeset viewer.