[wp-trac] [WordPress Trac] #37730: Maybe image crop function problem on 4.6 version please check on function

WordPress Trac noreply at wordpress.org
Fri Aug 19 05:53:01 UTC 2016


#37730: Maybe image crop function problem on 4.6 version please check on function
-------------------------------+------------------------------
 Reporter:  hmbashar           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  4.6
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback
 * component:  General => Media


Comment:

 Hi @hmbashar and welcome to Trac,

 Can you confirm that you're using this exact code, `add_image_size(
 'cb_member_img', 300, 300 );` and expecting that the generated images
 would be `300px` wide and `300px` tall no matter what image is uploaded?

 By default `add_image_size()` will scale an image proportionally, so if
 you upload a 500x500px image it'll get scaled to 300x300px, but if you
 upload a 2000x1000px image it'll get scaled down to 300x150px.
 The 4th parameter can be set to cause the image to be cropped to the exact
 dimensions specified, the
 [https://developer.wordpress.org/reference/functions/add_image_size/
 developer reference] includes documentation on that parameter and valid
 settings.

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


More information about the wp-trac mailing list