nextcloud/files_photospheres

Falsely identifying regular photos as photospheres

Closed this issue · 13 comments

I'm storing pictures from my DJI Mavic 2 Pro in nextcloud, and for some reason they are all displayed as a photosphere (even the regular photos).

A regular photo:

$ exiftool DJI_0002.JPG -XMP:ALL                                          
About                           : DJI Meta Data
Format                          : image/jpg
Absolute Altitude               : +169.29
Relative Altitude               : +1.40
Gimbal Roll Degree              : +0.00
Gimbal Yaw Degree               : -61.20
Gimbal Pitch Degree             : -0.90
Flight Roll Degree              : -2.00
Flight Yaw Degree               : -90.20
Flight Pitch Degree             : -4.00
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Self Data                       : Self data
Version                         : 7.0
Has Settings                    : False
Has Crop                        : False
Already Applied                 : False

A photosphere (it is detected as a photosphere correctly, so it's here just for reference)

$ exiftool DJI_0011.JPG -XMP:ALL
About                           : DJI Meta Data
Format                          : image/jpg
Absolute Altitude               : +121.77
Relative Altitude               : +10.40
Gimbal Roll Degree              : +0.00
Gimbal Yaw Degree               : +100.60
Gimbal Pitch Degree             : -16.80
Flight Roll Degree              : -0.10
Flight Yaw Degree               : +134.50
Flight Pitch Degree             : +0.70
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Self Data                       : Self data
Projection Type                 : equirectangular
Use Panorama Viewer             : True
Cropped Area Image Height Pixels: 4096
Cropped Area Image Width Pixels : 8192
Cropped Area Left Pixels        : 0
Cropped Area Top Pixels         : 0
Full Pano Height Pixels         : 4096
Full Pano Width Pixels          : 8192
Version                         : 7.0
Has Settings                    : False
Has Crop                        : False
Already Applied                 : False

If needed, I can also provide full EXIF dumps of those two pictures.

Photos taken from my DSLR are correctly identified as photos and displayed in the default viewer.

Versions:

  • NixOS 20.09
  • Nextcloud 19.0.0
  • Photospheres 1.19.0
  • Firefox 77.0.1
R0Wi commented

Thanks for reporting. Is it possible that you provide the two images (or at least one regular and one photosphere) somehow? I'd really like to have a look into the raw data which is processed by the apps backend.

Ok, a regular one: https://share.balsoft.ru/DJI_0024.JPG and a panorama: https://share.balsoft.ru/DJI_0308.JPG . If the speeds are too low on my server for you, ping me and I'll upload them somewhere else.

R0Wi commented

Thanks i'll analyze and report my results.

Hi, is there any progress on this? If not, is there a way I could help?

R0Wi commented

Sorry didn't have time to take a look at the images, yet. I'll keep you up to date and inform you if you can help, thanks.

R0Wi commented

So i did a quick lookup of the raw xmp-data blocks in you images and they look like this:

Regular:

<x:xmpmeta xmlns:x="adobe:ns:meta/">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="DJI Meta Data"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
    xmlns:drone-dji="http://www.dji.com/drone-dji/1.0/"
    xmlns:GPano="http://ns.google.com/photos/1.0/panorama/"
   xmp:ModifyDate="1970-01-01"
   xmp:CreateDate="1970-01-01"
   tiff:Make="DJI"
   tiff:Model="Test_Pro"
   dc:format="image/jpg"
   drone-dji:GpsLatitude="+54.7979709"
   drone-dji:GpsLongitude="+38.6677089"
   drone-dji:AbsoluteAltitude="+191.34"
   drone-dji:RelativeAltitude="+7.00"
   drone-dji:GimbalRollDegree="+0.00"
   drone-dji:GimbalYawDegree="+49.30"
   drone-dji:GimbalPitchDegree="-4.60"
   drone-dji:FlightRollDegree="+6.60"
   drone-dji:FlightYawDegree="+139.40"
   drone-dji:FlightPitchDegree="+3.50"
   drone-dji:CamReverse="0"
   drone-dji:GimbalReverse="0"
   drone-dji:SelfData="Self data"
   crs:Version="7.0"
   crs:HasSettings="False"
   crs:HasCrop="False"
   crs:AlreadyApplied="False">
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>

Pano:

<x:xmpmeta xmlns:x="adobe:ns:meta/">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="DJI Meta Data"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
    xmlns:drone-dji="http://www.dji.com/drone-dji/1.0/"
    xmlns:GPano="http://ns.google.com/photos/1.0/panorama/"
   xmp:ModifyDate="1970-01-01"
   xmp:CreateDate="1970-01-01"
   tiff:Make="DJI"
   tiff:Model="Test_Pro"
   dc:format="image/jpg"
   drone-dji:GpsLatitude="+54.4378418"
   drone-dji:GpsLongitude="+38.3883647"
   drone-dji:AbsoluteAltitude="+237.50"
   drone-dji:RelativeAltitude="+75.20"
   drone-dji:GimbalRollDegree="+0.00"
   drone-dji:GimbalYawDegree="+11.70"
   drone-dji:GimbalPitchDegree="-16.80"
   drone-dji:FlightRollDegree="-7.90"
   drone-dji:FlightYawDegree="-4.80"
   drone-dji:FlightPitchDegree="+0.10"
   drone-dji:CamReverse="0"
   drone-dji:GimbalReverse="0"
   drone-dji:SelfData="Self data"
   GPano:ProjectionType="equirectangular"
   GPano:UsePanoramaViewer="True"
   GPano:CroppedAreaImageHeightPixels="4096"
   GPano:CroppedAreaImageWidthPixels="8192"
   GPano:CroppedAreaLeftPixels="0"
   GPano:CroppedAreaTopPixels="0"
   GPano:FullPanoHeightPixels="4096"
   GPano:FullPanoWidthPixels="8192"
   crs:Version="7.0"
   crs:HasSettings="False"
   crs:HasCrop="False"
   crs:AlreadyApplied="False">
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>

As you can see both images contain some tags starting with GPano and thats the problem. So currently the app just checks the xmp-meta-block for any GPano tag and if there is one present it detects the image as photosphere and therefore shows it in the photosphere-viewer. Until now i did not know that GPano tags are used to provide additional information for the current image while the image don't necessarily has to be a photosphere. According to the documentation https://developers.google.com/streetview/spherical-metadata we should rather use the tag GPano:UsePanoramaViewer to determine if we should take the photosphere-viewer or not. Like you can see in the blocks above that would also fix your specific problem :-)

What i suggest now: i'll implement this fix and test it with all of my test-data i received so far by different users. If everything works as expected i can provide a new app-version soon. Agree on this so far ? :-)

R0Wi commented

Ok fix is done. Is it possible for you to checkout https://github.com/nextcloud/files_photospheres/tree/bugfix/%2353 an see if it fixes your problem?

Ok, thank you very much! I'll try the fix today as soon as I can.

Ok, I just tried it and it works!

Thanks a lot for fixing this!

Oh, I noticed another issue (I don't know if it's related to your bugfix): when I navigate my photo collection with photos "open", if I open a panorama, it shows as a regular picture. If I open that same panorama from "browse" view, it does open as a panorama.

R0Wi commented

Oh, I noticed another issue (I don't know if it's related to your bugfix): when I navigate my photo collection with photos "open", if I open a panorama, it shows as a regular picture. If I open that same panorama from "browse" view, it does open as a panorama.

Not quite sure if i got you right but if you're talking about switching between photos inside the viewer app, this scenario is currently not supported. There is a discussion at #27 where we think about a full integration of this app into the viewer-app (which is used to show regular images).

Like stated in the README.md the current functionallity is limited to regular file browser (either by being logged in or in a share-link-scenario).

Oh ok, that makes sense. Thank you once again!

R0Wi commented

Oh ok, that makes sense. Thank you once again!

You're welcome :-) Will merge this as soon as i tested all the internal stuff.