jupiter
jupiter

Reputation: 143

how can check panorama photo android?

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

Upvotes: 0

Views: 1247

Answers (2)

k3b
k3b

Reputation: 14755

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

Upvotes: 1

Stephan Branczyk
Stephan Branczyk

Reputation: 9375

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.

Upvotes: 1

Related Questions