[buddypress-trac] [BuddyPress Trac] #5089: Avatar rotation fix for iOS

buddypress-trac noreply at wordpress.org
Thu Oct 1 23:49:07 UTC 2015

#5089: Avatar rotation fix for iOS
 Reporter:  modemlooper              |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  2.4
Component:  Component - Attachments  |     Version:  1.0
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |
Changes (by imath):

 * component:  Component - Core => Component - Attachments
 * milestone:  Future Release => 2.4


 Wow how could I miss this ticket?? This issue is pretty annoying!!

 So first i was able to reproduce. And second we should really fix this for
 2.4 imho.

 I've been reviewing your patch @r-a-y. Many thanks for it, i think we can
 improve it a bit.

 1. i think an upside down photo could be less than 450px, so we shouldn't
 wait after the size check to eventually correct the photo orientation.
 2. i can understand the `wp_is_mobile()` check because people often don't
 use their phone or tablet in the right orientation. But like @shanebp i
 think we shouldn't presume this can only happen when a mobile upload is
 done. A good reason to do so is that someone can send you a photo he took
 upside down of you with his mobile by email, and you could use it from a
 regular PC.
 3. I agree again with @shanebp this trouble is now shared by the Cover
 Image, so the fix needs to be inside BP_Attachment, so that any class
 extending it: can use it.
 4. I don't think we need to do a WP Version check we can just use `!
 isset( $meta['orientation'] )`
 5. I think we can be more direct to fix the backcompat issue with WP <
 4.0. A little upper in the code we are using `getimagesize()` to get the
 width and height and the third parameter of what this function returns is
 what WordPress calls `$sourceImageType` :)

 So i'm suggesting 5089.04.patch to fix this issue :
 - i've tested it with avatars / cover images
 - i've tested it with avatars old UI
 - i've run the unit tests under WordPress 3.9.

 About the unit tests, i think we should include them even if we need to
 copy files during it, because i'd feel safer. I suggest to add the upside-
 down.jpg file to tests/phpunit/assets and use this little file to do our
 tests. (this upside down image is attached to this ticket).

 @shanebp, could you test the patch to confirm it's ok.
 If so i'll make a build with it and will update our test drive so that
 anyone can easily check it's ok using their mobile and turning it round
 and around before using the camera :)

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5089#comment:21>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list