[wp-trac] [WordPress Trac] #31296: Uploaded images are saved as a "resized" duplicate, if the size matches $_wp_additional_image_sizes

WordPress Trac noreply at wordpress.org
Tue Feb 24 20:38:44 UTC 2015


#31296: Uploaded images are saved as a "resized" duplicate, if the size matches
$_wp_additional_image_sizes
--------------------------+------------------------------
 Reporter:  wpdennis      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.1
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by rowd1951):

 * severity:  normal => major


Comment:

 I have also noticed this bug, but did not have the skill that @wpdennis
 did to work out what the cause was!

 So, after seeing wpdennis' ticket, I went into a test website and edited
 those lines of the media.php file in the Wordpress core to how they were
 in version 4.0 and, sure enough, the problem went away.

 Basically, if your blog has featured images of the dimensions 600x200
 pixels, for example, and you created an image called blogpostimage.jpg for
 your latest article which is exactly the required 600x200 pixels, before
 this change was introduced in v4.1 (i.e. 4.0 and previous) then when
 uploading blogpostimage.jpg, that file would be used as the image,
 wherever that size was required, and no duplicate of the same size was
 ever created.

 Now what happens is an IDENTICAL version of blogpostimage.jpg is created
 called blogpostimage-600x200.jpg AS WELL as the original
 blogpostimage.jpg, which is bad enough because it's a redundant image
 taking up unnecessary space, but what makes this bug worse is that it is
 THIS file e.g. blogpostimage-600x200.jpg which is being used as the
 featured image/thumbnail, and it's not nice.

 Please can this be sorted? The last thing on earth I thought I'd do is to
 have to edit a WP core file, it's a cardinal sin, but unless this bug is
 changed, I'm afraid I think I'll have to, and that's not good form -it
 makes me feel dirty!

 The original code in the media.php file worked fine, can't it be reverted,
 or fixed? Also, there has been an update to 4.1 already, I only noticed
 this error recently after 4.1.1 or I would have flagged it up earlier.

 I'd like to thank wpdennis.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31296#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list