how can check panorama photo android?

吃可爱长大的小学妹 提交于 2019-12-01 12:50:07

问题


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 photo?

Thanks


回答1:


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.




回答2:


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);


来源:https://stackoverflow.com/questions/33337864/how-can-check-panorama-photo-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!