how can check panorama photo android?

前端 未结 2 2028
一整个雨季
一整个雨季 2021-01-17 05:33

I need to show all panorama photo in Gallery android. But it extension is jpg same regular photo.

How can I check a photo in Gallery android is Panorama

相关标签:
2条回答
  • 2021-01-17 05:51

    Ask the mediadatabase through a filter condition

    Where ((height/width > 2) or (width/height >= 2))
    

    something like this

        ContentResolver resolver = context.getContentResolver();
        Cursor query = resolver.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 
          sqlSelectColums, '((height/width > 2) or (width/height >= 2))', 
          null, sqlSortOrder);
    
    0 讨论(0)
  • 2021-01-17 06:01

    You'll need to extract the XMP Metadata

    XMP Metadata is essentically image metadata...

    ...encoded in some XML-friendly format, such as Base64.

    See this previous question/answers on StackOverflow to see how to decode Base64.

    Based on the xml you can decode from the jpeg, you may be able to guess the intent-filter you'll need. In the case of a photo sphere panorama format for instance, this is the format.

    If you want to accept Photo Sphere images in your own Android apps, you can add the custom MIME type application/vnd.google.panorama360+jpg to the relevant IntentFilter in your app.

    However, I'm not sure what type of panorama your jpeg is in. It may help if you posted the particular jpeg with your question.

    0 讨论(0)
提交回复
热议问题