rotated images from iphone uploads

261 views
Skip to first unread message

Stephen S

unread,
Nov 16, 2017, 3:22:37 AM11/16/17
to ResourceSpace
When uploading images from mobile safari on iphones (into RS 8.3), all the photos show up rotated (90 degrees CCW). When looking at the exif data for each of these images, I noticed there is an exif tag "orientation (w)" that lists a value of "Rotate 90 CW", so the info is clearly there but not being accounted for. My question is this: Is there a pref somewhere to auto-rotate these images correctly on upload, or do I need to write some code that will search for the exif tag and do this myself?

Allison Stec

unread,
Nov 16, 2017, 8:33:51 AM11/16/17
to resour...@googlegroups.com, Stephen S
Last I knew, location data was stripped from files uploaded via a mobile browser. This is something that happens at the browser level as a security precaution. Other applications get around this by creating mobile apps for uploading.

Allison Stec



On November 16, 2017 at 3:22:41 AM, Stephen S (ssu...@gmail.com) wrote:

When uploading images from mobile safari on iphones (into RS 8.3), all the photos show up rotated (90 degrees CCW). When looking at the exif data for each of these images, I noticed there is an exif tag "orientation (w)" that lists a value of "Rotate 90 CW", so the info is clearly there but not being accounted for. My question is this: Is there a pref somewhere to auto-rotate these images correctly on upload, or do I need to write some code that will search for the exif tag and do this myself?
--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.com
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen S

unread,
Nov 16, 2017, 9:41:04 AM11/16/17
to ResourceSpace
Thanks for the reply Allison. And although I haven't verified every exif tag, I can assure you most if not all meta data is not stripped from files on upload (at least from the built in iphone camera's files, and not in mobile safari), and in any event, I am talking about orientation of the image, not GPS data. It looks like I might have to make a plugin that short circuits the upload process to extract and respond to this exif tag in particular.

Allison Stec

unread,
Nov 16, 2017, 10:03:20 AM11/16/17
to resour...@googlegroups.com, Stephen S
My point was that other data could be stripped in the process, so be sure to verify that the file in RS still has the embedded data. It sounds like you’ve already done this, so it’s not likely the issue.

Maybe you need to turn the following config option on?

# On some PHP installations, the imagerotate() function is wrong and images are rotated in the opposite direction
# to that specified in the dropdown on the edit page.
# Set this option to 'true' to rectify this.
$image_rotate_reverse_options=false;

Allison Stec


Stephen S

unread,
Nov 16, 2017, 10:16:38 AM11/16/17
to ResourceSpace
I believe this only affects applying an effect to an already uploaded preview, no? (Which works fine for me already btw. I am just trying to get the uploaded images to be rotated automatically to match their original orientation on the phone).

Allison Stec

unread,
Nov 16, 2017, 11:59:41 AM11/16/17
to resour...@googlegroups.com, Stephen S
You’re right, that’s not actually tied to uploading code.

Have you looked in the resource log and/or debug log to verify that some rotation was triggered? If the tag exists and your config settings allow for auto-rotation on upload you should see signs of this.

I'll throw out the ideas of uploading the same files from a different mobile browser (or desktop browser) to verify that this is specific to mobile Safari and verifying that the image appears properly rotated when displayed outside of RS on the chance you haven’t already tried.

Allison Stec


Stephen S

unread,
Nov 17, 2017, 2:39:06 AM11/17/17
to ResourceSpace
Hi Allison,

When you said "if your config settings allow for auto-rotation on upload" I realized I was aware of no such setting. After scouring the config.default.php file, I found the following setting which when set to true, does exactly what I want it to do, correcting for the orientation:

$camera_autorotation = true;

Thanks!

Stephen
Reply all
Reply to author
Forward
0 new messages