Skip to content

Commit

Permalink
Create a full sized image for smaller heic uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilverstein committed Oct 28, 2024
1 parent 0fb4f61 commit e8613c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wp-admin/includes/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ function wp_create_image_subsizes( $file, $attachment_id ) {
* If the original image's dimensions are over the threshold,
* scale the image and use it as the "full" size.
*/
if ( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) {
if (
( $threshold && ( $image_meta['width'] > $threshold || $image_meta['height'] > $threshold ) ) ||
( 'image/heic' === $imagesize['mime'] && $image_meta['width'] <= $threshold )
) {
$editor = wp_get_image_editor( $file );

if ( is_wp_error( $editor ) ) {
Expand Down

0 comments on commit e8613c6

Please sign in to comment.