Photo orientation. Survey123 app

4074
19
06-28-2020 11:05 AM
Fco_JavierRomero
New Contributor III

I am trying to get the orientation of the photo taken in survey123 app in order to correct the direction of them. I have checked that with the device vertically the direction of the photo is correct, but if we touch the photo with the device horizontally, the direction is incorrect. This is because the direction is taken with respect to the longitudinal axis of the device. To correct it I've thought about using the imageorientation variable of the EXIF data, using the pulldata() function that returns the orientation of the mobile device, with values from 1 to 8:

FlagOrientationDescription
10 degreesthe correct orientation, no adjustment is required.
20 degrees, mirroredimage has been flipped back-to-front.
3180 degreesimage is upside down.
4180 degrees, mirroredimage is upside down and flipped back-to-front.
590 degreesimage is on its side.
690 degrees, mirroredimage is on its side and flipped back-to-front.
7270 degreesimage is on its far side.
8270 degrees, mirroredimage is on its far side and flipped back-to-front.

exif orientation values

but it seems that the photos taken from survey123 app do not take this value correctly, or at least that I have been able to check.

I would appreciate any indications about it. Thanks a lot.

0 Kudos
19 Replies
MarcGraham2
Occasional Contributor III

Hi @Anonymous User 

Apologies, I sent my message from a phone and was not clear.  I am also having this issue (in bold):

------------------------------------------------------------

by Fco_JavierRomero

New Contributor III
 
I am trying to get the orientation of the photo taken in survey123 app in order to correct the direction of them. I have checked that with the device vertically the direction of the photo is correct, but if we touch the photo with the device horizontally, the direction is incorrect. This is because the direction is taken with respect to the longitudinal axis of the device.
-------------------------------------------------------------
 
When we take Photos with an iPad in landscape mode  the direction of  the images is out by 90°.  The iPads are definitely not locked to portrait mode as the app responds correctly when the device is rotated.
It seems like S123 needs to be modified to take this into account and add an adjustment to the image direction.
 
Regards,
Marc
0 Kudos
HowardBeverly1
New Contributor II

I use Survey123 to capture field photos and one of the things I record is the direction the photo is facing using pulldata("@exif", ${image}, "GpsImgDirection") then covert to a direction like North, Northeast, etc. However almost all my photos are required to be horizontal and the GpsImgDirection value recorded is offset by 90 degrees when I take a horizontal photo. I wonder if Survey123's problem of handling horizontal photos is related.  To work around this I've set a calc field to add 90 degrees since more than 90 percent of my photos are horizontal anyways, and set my direction field to be manually if I don't agree with the direction conversion. 

MarcGraham2
Occasional Contributor III

Hi there,

I can also confirm (using the exif sample from Survey123 Connect to test) that Survey123 only ever writes 1 to the ImageOrientation exif tag.  Using the same sample with images loaded into the image question from the native iphone or ipad camera app yields different values for portrait and landscape photos.

Thanks,

Marc

0 Kudos
by Anonymous User
Not applicable

Hi @MarcGraham2,

Thanks, we are looking into this issue, it appears the when orientation lock is enabled on iOS, it changes the ImageOrientation exif tag to be 1. This of course causes issues with knowing the orientation of the device when the image was taken and displaying it the correct way.

Regards,

Phil.

0 Kudos
MarcGraham2
Occasional Contributor III

Hi Phil,

In our experience it also doesn't work correctly when orientation lock is not enabled.

Using your exif sample on an iPhone XR with orientation lock turned off I get values of 1 for both a portrait and landscape image. Notably the camera view doesn't re-orient when in landscape mode, perhaps for the phone version you have hardcoded it to always be portrait?

Regards,

Marc

0 Kudos
by Anonymous User
Not applicable

Hi @MarcGraham2,

That's interesting. What version of iOS is on that device? I tested a whole range of iOS devices in our office and didn't see the issue with orientation lock off. We do have an XR which I need to test again?

Have you tried other iOS devices, does it happen with other models?

The app is locked on iPhones in portrait mode, but not the camera. So when you turn the device sideways (landscape) the app will still be in the portrait orientation, but when you open the camera, it will take a landscape photo. This is all provided that the OS provides the correct orientation of the device. Maybe the XR or certain iOS version is reported the orientation incorrectly (ie the 1 you are seeing).

Regards,

Phil.

0 Kudos
by Anonymous User
Not applicable

Hi @Fco_JavierRomero @MarcGraham2 @HowardBeverly1 @AaronWorthley1 @DougBrowning,

We have just released the 3.15 July Update today of Survey123 Connect and Field app which includes fixes for image orientation values being stored in EXIF data incorrectly, and also a fix for the the orientation lock on iOS being enabled and causing the orientation of landscape images to be incorrect. Please test out the latest builds and let us know if you still have issues with orientation information from images.

See the announcement here: https://community.esri.com/t5/arcgis-survey123-blog/what-s-new-in-arcgis-survey123-july-2022/ba-p/11...

Regards,

Phil.

MarcGraham2
Occasional Contributor III

That's great. Thanks for the Update @Anonymous User 

0 Kudos
IlkaIllers1
Occasional Contributor III

Is anyone else still having problems with this? I just added ImageOrientation to my Survey, and did a test run: I wanted to go through 1-8 in the correct order. Instead I got 6-6-8-8-1-3-3-1 as the image orientation and am wholly confused now.

SandyShannon
New Contributor

Yes, my team is still having this issue. My team has tested taking the same photo 4 times with the screen's orientation lock off: 1) horizontal photo with camera at left, 2) horizontal photo with camera at right, 3) vertical photo with camera at top, and 4) vertical photo with camera at bottom. All four test photos record a different photo direction. The only one that is correct is the vertical photo with the camera at top. Would appreciate help with this. 

0 Kudos