Media: Add link to the original image in the image properties if it was scaled or rotated after uploading.

Fixes #49290.

git-svn-id: https://develop.svn.wordpress.org/trunk@47202 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2020-02-07 05:11:45 +00:00
parent f91e983acb
commit 112649ea92
3 changed files with 26 additions and 0 deletions
+5
View File
@@ -3560,6 +3560,11 @@ function wp_prepare_attachment_for_js( $attachment ) {
}
if ( 'image' === $type ) {
if ( ! empty( $meta['original_image'] ) ) {
$response['originalImageURL'] = wp_get_original_image_url( $attachment->ID );
$response['originalImageName'] = wp_basename( wp_get_original_image_path( $attachment->ID ) );
}
$sizes['full'] = array( 'url' => $attachment_url );
if ( isset( $meta['height'], $meta['width'] ) ) {