Automattic / Automattic/regenerate-thumbnails

Unexpected behaviour when new size is larger than full image

Open
#86 4 comments 0 reactions 0 assignees View on GitHub
[Status] Accepted [Type] Bug
Dominant language
PHP
Stars
137
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Suppose a site has post thumbnails set to 200x200; I change this to 600x600 and regenerate thumbnails (telling the plugin to skip correctly sized images).

If after doing so, I upload a new 400x400 image, the post-thumbnail size won't get created in the metadata (since it is too small), so when the theme calls the_post_thumbnail(), it will output the full 400x400 image.

However, if a 400x400 image was uploaded prior to regeneration, when the theme calls the_post_thumbnail, it will output the original 200x200 image.

This is because the plugin is skipping the thumbnail size ('thumbnail would be larger than original'), but leaving the old size in the metadata, rather than removing it.

I believe removing it would be the logical behaviour.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two upload and regeneration cases described in the issue, then trace the plugin's thumbnail regeneration and metadata update path. Done means that a skipped thumbnail size is removed from existing metadata when it would be larger than the original, while the described full-image behavior remains consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.