Simple Machines Community Forum

SMF Development => Feature Requests => Topic started by: bwaynef on February 07, 2016, 09:16:56 PM

Title: Auto-Rotation of pictures
Post by: bwaynef 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 (http://resize%20attached%20images) 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?
Title: Re: Auto-Rotation of pictures
Post by: margarett 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 )
Title: Re: Auto-Rotation of pictures
Post by: bwaynef on February 08, 2016, 10:00:54 AM
Quote from: bwaynef on February 07, 2016, 09:16:56 PMaplumb

It's aplomb.  Hopefully you'll let me blame this on posting late at night.
Title: Re: Auto-Rotation of pictures
Post by: dougiefresh 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....
Title: Re: Auto-Rotation of pictures
Post by: Antechinus on February 23, 2016, 10:10:22 PM
Nick Elk's code. They implemented this some time back. ;)
Title: Re: Auto-Rotation of pictures
Post by: dougiefresh 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....
Title: Re: Auto-Rotation of pictures
Post by: Antechinus on February 23, 2016, 10:24:58 PM
Ok, well the basic discussion was here, if it's any help: Image Orientation (http://www.elkarte.net/community/index.php?topic=2509.0)
Title: Re: Auto-Rotation of pictures
Post by: dougiefresh on February 23, 2016, 11:11:47 PM
Thanks!  That actually helps a lot!
Title: Re: Auto-Rotation of pictures
Post by: dougiefresh 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 (http://www.simplemachines.org/community/index.php?topic=543612.new#new) 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.....
Title: Re: Auto-Rotation of pictures
Post by: Rob Lightbody on April 02, 2018, 08:54:10 AM
Quote from: bwaynef on February 07, 2016, 09:16:56 PM
I'm hemorrhaging users who are becoming accustomed to Facebook handling the resizing (http://resize%20attached%20images) and auto-rotating of images with the click of the upload/post button. 

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

I second that.  To compete with Facebook, somehow, this stuff just needs to work.
Title: Re: Auto-Rotation of pictures
Post by: Kindred on April 02, 2018, 11:14:51 AM
the mod exists.
Title: Re: Auto-Rotation of pictures
Post by: dougiefresh on April 03, 2018, 05:52:39 PM
Try this: Automatic Attachment Rotation (https://www.simplemachines.org/community/index.php?topic=544111.0)