[wp-trac] [WordPress Trac] #16458: image_resize() treats all resized images resulting in JPEG as having the .jpg extension

WordPress Trac wp-trac at lists.automattic.com
Mon Feb 27 02:34:34 UTC 2012


#16458: image_resize() treats all resized images resulting in JPEG as having the
.jpg extension
------------------------------------+------------------
 Reporter:  kawauso                 |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  3.4
Component:  Filesystem              |     Version:  3.0
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by SergeyBiryukov):

 Having some issues with [attachment:16458.diff] on 3.4-alpha-19998, Twenty
 Eleven, default media settings.

 1. Uploading `Untitled.jpg` (1000x1000) results in 6 files:
 {{{
 Untitled.jpg
 Untitled-1000x288.jpg
 Untitled-150x150.jpg
 Untitled-300x300.jpg
 Untitled1-1000x288.jpg
 Untitled1-300x300.jpg
 }}}
 Two of them are the same, so there should be only four. Apparently
 `image_resize()` can be called multiple times with the same parameters.

 2. Uploading `Untitled.jpeg` then results in 4 files:
 {{{
 Untitled.jpeg
 Untitled-1000x288.jpg
 Untitled-150x150.jpg
 Untitled-300x300.jpg
 }}}
 Three of them overwrite the intermediate sizes of the previous image. This
 creates orphaned DB records when either image is deleted.

 Without the patch, issue 2 still happens, but issue 1 doesn't.

 We can probably just preserve `.jpeg` extension
 ([attachment:16458.2.diff]).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16458#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list