wp-cli / media-command

Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
MIT License
44 stars 41 forks source link

Regenerating BIG Images Edited by User #136

Open ddur opened 4 years ago

ddur commented 4 years ago

Bug Report

Test case 1, Step 1

As first step, just upload JPEG image that is larger than your current setting for 'big_image_size_threshold' (default is 2560 pixels). That would trigger automatic SCALING of image, on upload (see function wp_create_image_subsizes() in image.php). Make sure that your 'big_image_size_threshold' filter is not disabled or has value higher than your image pixel sizes.

Test case 2, Step 1

Another test would be to upload JPEG image with exif metadata [orientation] set to 2, 3 or 4. That would trigger automatic ROTATING of image on upload (see function wp_create_image_subsizes() in image.php), regardless of 'big_image_size_threshold'.

Further Test Steps for Test cases 1 & 2

Step 2: Edit the image (resize, rotate or flip etc) to get new metadata [sizes] set with edited images (where names are changed by new dimensions (WxH) and suffixing base-name with '-e' + 13 numeric characters).

Step 3: Regenerate the thumbnails.

Result: As far as I can read the code, edited image won't be attached anymore and in attachment metadata, edited thumbnails will be replaced with original thumbnails as created at upload.

Preconditions to be met:

This case is related only to NOT PNG ( == JPEG and maybe more?) type of images.

Original issue: https://github.com/Automattic/regenerate-thumbnails/issues/102

Attn: @azaozz

swissspidy commented 1 year ago

Steps, in other words, from https://github.com/Automattic/regenerate-thumbnails/issues/102: