Changeset 53848
- Timestamp:
- 08/05/2022 10:14:09 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r53847 r53848 342 342 343 343 if ( ! empty( $additional_mime_types ) ) { 344 // Use the original file's exif_meta orientation information for secondary mime generation. 345 $saved_orientation = $image_meta['image_meta']['orientation']; 344 // Use the original file's exif_meta orientation and size information for secondary mime generation to ensure 345 // sub-sized images are correctly scaled and rotated. 346 347 // Save data. 348 $saved_meta = array(); 349 $saved_meta['orientation'] = $image_meta['image_meta']['orientation']; 350 $saved_meta['width'] = $image_meta['width']; 351 $saved_meta['height'] = $image_meta['height']; 352 353 // Temporarily set the image meta to the original file's meta. 346 354 $image_meta['image_meta']['orientation'] = $exif_meta['orientation']; 347 $image_meta = _wp_make_additional_mime_types( $additional_mime_types, $file, $image_meta, $attachment_id ); 348 $image_meta['image_meta']['orientation'] = $saved_orientation; 355 $image_meta['width'] = $imagesize[0]; 356 $image_meta['height'] = $imagesize[1]; 357 358 $image_meta = _wp_make_additional_mime_types( $additional_mime_types, $file, $image_meta, $attachment_id ); 359 360 // Restore the saved meta data. 361 $image_meta['image_meta']['orientation'] = $saved_meta['orientation']; 362 $image_meta['width'] = $saved_meta['width']; 363 $image_meta['height'] = $saved_meta['height']; 349 364 350 365 }
Note: See TracChangeset
for help on using the changeset viewer.