nextcloud/files_photospheres

Use EXIF to determine photo orientation

Closed this issue · 7 comments

When you create a panorama/photo sphere using a smartphone, depending on your phones orientation while capturing the image, you can end up with an image that is stored 'upside down', but the EXIF should state that. Currently this app seems to not process this information, so some of my panoramas are shown upside down. Could this be fixed?

Awesome app by the way!

R0Wi commented

Hi @siccovansas, thanks for your feedback. Since the app only integrates the Photosphere Viewer JS library, which is then responsible for showing the image, i'm afraid there's not much we can do here. Like discussed in #1 an option might be to update the component to version 4 which is now released (currently we're using version 3). But i don't know if the viewer supports the desired functionallity then. If you're okay with that you could provide some sample-data and i'll try?

Hi @R0Wi, thanks for your reply! Here is an example image that is shown upside down: https://we.tl/t-4gmfXk2ovp (the image is larger than GitHub's 10MB attachment limit, so I needed to use an external service)

R0Wi commented

Hi @R0Wi, thanks for your reply! Here is an example image that is shown up side down: https://we.tl/t-4gmfXk2ovp (the image is larger than GitHub's 10MB attachment limit, so I needed to use an external service)

Thanks for the sample. I did a quick setup with the PhotosphereViewer component like described here. Unfortunately i got the following warnings in the browser console and the screen stays black:

psv.js:11 PhotoSphereViewer: invalid XMP data

three.min.js:131 WebGL: INVALID_VALUE: texImage2D: bad image data
[.WebGL-0x3c3319f0e300]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

So it seems that the viewer has problems showing your specific image because of it's metadata. I extracted the XMP-metadata of your image and it looks like this:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
 <rdf:Description rdf:about="" xmlns:GPano="http://ns.google.com/photos/1.0/panorama/" 
GPano:ProjectionType="cylindrical"
GPano:CroppedAreaImageWidthPixels="12896" 
GPano:CroppedAreaImageHeightPixels="3824" 
GPano:FullPanoWidthPixels="23800" 
GPano:CroppedAreaLeftPixels="5452" 
GPano:CroppedAreaTopPixels="-1912"/> 
</rdf:RDF> 
</x:xmpmeta>

I'm not an absolute XMP expert but what i can say is that the ProjectionType of my images is usally equirectangular. Also negative CroppedAreaTopPixels looks a bit strange. Maybe you could ask the developers of Photosphere Viewer JS for help here and add a link to this issue?

Thanks for looking into it! I'll open an issue at the Photosphere Viewer JS repo and link back to here 👍

R0Wi commented

Closing this for now. Please reopen if the app itself can help to overcome the issue.

Over at Photosphere Viewer JS they don't see any issues with the image, so I guess that version 4 fixes it.

Woops, I misunderstood. Apparently version 4 doesn't fix it and my image seems to be the problem. Nothing you can do then :)