[buddypress-trac] [BuddyPress Trac] #5617: Improved image size detection during cropping process

buddypress-trac noreply at wordpress.org
Mon May 5 16:25:46 UTC 2014

#5617: Improved image size detection during cropping process
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  2.1
Component:  Avatars       |    Version:
 Severity:  normal        |   Keywords:  has-patch 2nd-opinion
 Our interface for uploading and cropping avatar images is not friendly to
 people who are uploading small images. It encourages poor cropping, which
 results in ugly upsizing.

 I have a few suggestions for improvement:

 __1. Do a better job determining the default size of the cropper box.__

 Our current logic https://buddypress.trac.wordpress.org/browser/tags/2.0
 /bp-core/bp-core-cssjs.php#L44 is to set the cropper size to a square that
 is half the width/height of the image. This works pretty well for large
 uploads. But for small images - say, a 200x200 image - it suggests a
 100x100 crop, which is smaller than the default 'full' avatar dimensions
 of 150x150. I propose the following revisions:

 a. When the uploaded image is smaller than full-height/full-width (150x150
 by default), cropper default should be the full image size.
 b. When the uploaded image is larger than 150x150, but smaller than 2x in
 either direction, cropper default should be 150x150.
 c. When the uploaded image is larger than 300x300, use the width-divided-
 by-2 formula currently in place

 This is not perfect, but it's better than what we've got. In case (b) it
 will suggest a crop that will not be upsized (in contradiction to the
 current setup). In case (a) it will still suggest an image that needs
 upsizing, but at least the upsizing will be minimized.

 See attached patch for implementation.

 __2. Display a warning when the uploaded image is smaller than full-width
 x full-height__

 See attached patch for suggested wording. In the patch, I'm using
 `bp_core_add_message()` to rely on our internal standards. But the
 resulting placement of the error box is far from ideal - it's way up on
 the page, and likely to be missed. Might want to think about something
 closer to the cropper. Also, if we're going to suggest uploading another
 image, we might want to have a "Back" button.

 __3. Prevent the use of undersized images altogether__

 Another strategy is simply to reject too-small images. That'll help us
 avoid some of the problems described above. If we decided to do this, my
 #2 above is irrelevant, as is #1 part (a) (part (b) is still relevant).

 In any case, let's do *something*.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5617>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list