_wp_image_meta_replace_original example

$rotated = $resized;
            }

            if ( ! is_wp_error( $resized ) ) {
                /* * Append "-scaled" to the image file name. It will look like "my_image-scaled.jpg". * This doesn't affect the sub-sizes names as they are generated from the original image (for best quality). */
                $saved = $editor->save( $editor->generate_filename( 'scaled' ) );

                if ( ! is_wp_error( $saved ) ) {
                    $image_meta = _wp_image_meta_replace_original( $saved$file$image_meta$attachment_id );

                    // If the image was rotated update the stored EXIF data.                     if ( true === $rotated && ! empty( $image_meta['image_meta']['orientation'] ) ) {
                        $image_meta['image_meta']['orientation'] = 1;
                    }
                } else {
                    // TODO: Log errors.                 }
            } else {
                // TODO: Log errors.             }
        }
Home | Imprint | This part of the site doesn't use cookies.