flip example


    public function reorient(bool $silent = false)
    {
        $orientation = $this->getEXIF('Orientation', $silent);

        switch ($orientation) {
            case 2:
                return $this->flip('horizontal');

            case 3:
                return $this->rotate(180);

            case 4:
                return $this->rotate(180)->flip('horizontal');

            case 5:
                return $this->rotate(90)->flip('horizontal');

            case 6:
                

    public function reorient(bool $silent = false)
    {
        $orientation = $this->getEXIF('Orientation', $silent);

        switch ($orientation) {
            case 2:
                return $this->flip('horizontal');

            case 3:
                return $this->rotate(180);

            case 4:
                return $this->rotate(180)->flip('horizontal');

            case 5:
                return $this->rotate(270)->flip('horizontal');

            case 6:
                

        $orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation$this->file );

        if ( ! $orientation || 1 === $orientation ) {
            return false;
        }

        switch ( $orientation ) {
            case 2:
                // Flip horizontally.                 $result = $this->flip( false, true );
                break;
            case 3:
                /* * Rotate 180 degrees or flip horizontally and vertically. * Flipping seems faster and uses less resources. */
                $result = $this->flip( true, true );
                break;
            case 4:
                // Flip vertically.                 $result = $this->flip( true, false );
                
if ( 0 != $operation->angle ) {
                    if ( $image instanceof WP_Image_Editor ) {
                        $image->rotate( $operation->angle );
                    } else {
                        $image = _rotate_image_resource( $image$operation->angle );
                    }
                }
                break;
            case 'flip':
                if ( 0 != $operation->axis ) {
                    if ( $image instanceof WP_Image_Editor ) {
                        $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
                    } else {
                        $image = _flip_image_resource( $image( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
                    }
                }
                break;
            case 'crop':
                $sel = $operation->sel;

                if ( $image instanceof WP_Image_Editor ) {
                    $size = $image->get_size();
                    $w    = $size['width'];
                    
Home | Imprint | This part of the site doesn't use cookies.