@gaurav984
When you upload a big image big-image.jpg
, WP downscales it and save it under big-image-scaled.jpg
. The metadata will looks like this:
[
"file" => "2021/12/big-image-scaled.jpg",
"original_image" => "big-image.jpg"
//...
]
When you edit the image, WP replaces the big-image-scaled.jpg
with big-image-scaled-e1640788653513.jpg
, then the metadata will become:
[
"file" => "big-image-scaled-e1640788653513.jpg",
"original_image" => "big-image.jpg"
//...
]
Since the plugin regenerate thumbnails based on the original image big-image.jpg
(see code snippet below), the edited one is ignored, which explains the problem reported by @cemserdar.
if ( function_exists( 'wp_get_original_image_path' ) ) {
$fullsize = wp_get_original_image_path( $post->ID );
} else {
$fullsize = get_attached_file( $post->ID );
}
File: regenerate-thumbnails.php, line: 395
In order to regenerate thumbnails based on the edited image, the code above needs to be changed to something like this:
$fullsize = get_attached_file( $post->ID );
$image_edited = preg_match( '/scaled-e\d+\.[A-Za-z]+$/', wp_basename( $fullsize ) );
if( ! $image_edited && function_exists( 'wp_get_original_image_path' ) ) {
$fullsize = wp_get_original_image_path( $post->ID );
}