Advertisement:

Author Topic: Auto-Rotation of pictures  (Read 13116 times)

Offline bwaynef

  • Semi-Newbie
  • *
  • Posts: 61
Auto-Rotation of pictures
« on: February 07, 2016, 09:16:56 PM »
I've read several posts about this.  Essentially, someone posts a picture from their phone and when the attachment is accessed, its sideways.  Apparently the thumbnail that the iDevice creates is oriented correctly, but the image itself isn't.  I suspect that data is stored in EXIF data somewhere.

It's also my understanding that this has been handled in at least one gallery product, but I'm not positive of that.  I've read that its not broken and won't be fixed.  I've read its non-trivial.  I've read that simply because ipboard and vBulletin have a feature isn't justification enough for it to be implemented in smf.

I'm hemorrhaging users who are becoming accustomed to Facebook handling the resizing and auto-rotating of images with the click of the upload/post button.  Turns out, the only other major forum whose niche my forum shares also manages to handle both these issues with aplumb.

Could anyone point me to where those changes would need to be made if this can't be dealt with officially?

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Auto-Rotation of pictures
« Reply #1 on: February 08, 2016, 07:24:51 AM »
That's something I also think should exist but unfortunately it's out of my coding league...
This should be pretty much it
http://stackoverflow.com/questions/7489742/php-read-exif-data-and-adjust-orientation
(adapted to SMF's guts of course :P )
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline bwaynef

  • Semi-Newbie
  • *
  • Posts: 61
Re: Auto-Rotation of pictures
« Reply #2 on: February 08, 2016, 10:00:54 AM »
aplumb

It's aplomb.  Hopefully you'll let me blame this on posting late at night.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Auto-Rotation of pictures
« Reply #3 on: February 23, 2016, 10:08:30 PM »
Are you talking ONLY about attachments?  OR are you asking about regular images, such as those produced by the [url=x]y[/url] and [url]x[/url] constructs as well?  Cause I think I can whip something up for just attachments.....  If you are asking about image rotation for the other thing I mentioned, then that can definitely be time-consuming and would in most cases be better off storing the modified pictures on the server itself, you know, kinda like "process-once-show-many" process....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: Auto-Rotation of pictures
« Reply #4 on: February 23, 2016, 10:10:22 PM »
Nick Elk's code. They implemented this some time back. ;)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Auto-Rotation of pictures
« Reply #5 on: February 23, 2016, 10:14:39 PM »
The only problem with "borrowing" ElkArte's code is that the entire codebase has been rewritten.  I'd have to do a considerable amount of searching to borrow that code.....  It's a bit easier to borrow from their templates, as some of them haven't changed that much....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,136
  • Master of BBC Abuse
Re: Auto-Rotation of pictures
« Reply #6 on: February 23, 2016, 10:24:58 PM »
Ok, well the basic discussion was here, if it's any help: Image Orientation

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Auto-Rotation of pictures
« Reply #7 on: February 23, 2016, 11:11:47 PM »
Thanks!  That actually helps a lot!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,423
    • XPtsp.com Community
Re: Auto-Rotation of pictures
« Reply #8 on: February 24, 2016, 09:53:05 AM »
I've finished the mod, however, I'm unable to test the mod.  I've submitted it over here so that someone brave might be the beta tester. 

It doesn't error on my machine, but I can't test because neither my localhost or shared server support getting the EXIF information.....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!