Automattic / Automattic/regenerate-thumbnails

Regenerating Images Edited by User.

Open
#102 12 comments 1 reaction 0 assignees View on GitHub
[Type] Bug
Dominant language
PHP
Stars
137
Forks
54
PR merge metrics
No merged PRs in 30d

Description

After function "**wp_create_image_subsizes**" **scales** or **rotates** original image on upload/regenerate, and file is then **EDITED** by user (cropped/resized/flipped etc), function "**wp_get_original_image_path**" will return **ORIGINAL** image path instead of **EDITED**/attached file path. Regenerate (again "**wp_create_image_subsizes**") using **ORIGINAL** image path, will destroy **EDITED** file metadata, and attach wrong (scaled/rotated) file as post attachment.

My proposal is not to use "**wp_get_original_image_path**" if get_attached_file( $this->attachment->ID ) is **EDITED**

Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading wp_create_image_subsizes and wp_get_original_image_path, then inspect how get_attached_file is used for edited images during regeneration. Reproduce regeneration after a user edit and verify that edited file metadata and the attached file path are preserved rather than replaced by the scaled or rotated original.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.