1

I'm trying to get the exif of user comment using native Android API associated with ExifInterface.TAG_USER_COMMENT

this value should return a String but unfortunately seems that the String is encoded in some way.

E.g. if I get the user comment TAG of this image I get this String:

MNS G16 IN10 N5 O1.00 Y0.00 C0.00 YT0 CT0 s0 sY1.00 S350 C20 FM0 FC111011001:zzzzzz0 b194 0278044079c3f65883c014c0 bac1061ea 3d 3d357250294 0 0 0 0 0 0 0 0294 182 130 60 5 1287 180 121 5e 5 1288 cb a5 5e 0 0292 f2 cc 61ff 029c 158 121 5f 5 02a6 192 141 5e 5 02b0 1d5 175 60 5 02ba 1ef 188 60 5 02c4 200 178 5e 5 02ce 1d4 15a 5c 5 02ba 168 134 5f 5 0535b535b535b535b4840484048404840 f f f f f f f f23202320232023201a321a321a321a323c373c373c373c37 e e e e e e e e1718171817181718181b181b181b181b138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388138813881388

How should I handle the result in order to get an human readable text?

AndreaF
  • 11,975
  • 27
  • 102
  • 168
  • Which `ExifInterface` implementation are you using? There are three of them. BTW, `exiftool` on the desktop reports the same cryptic tag content, so my guess the problem is in how the image was created, not in `ExifInterface`. What is that tag supposed to contain? – CommonsWare Jun 27 '19 at 17:18
  • @CommonsWare now I'm using `androidx.exifinterface:exifinterface` but also with previous support library I get same result. – AndreaF Jun 27 '19 at 17:21
  • The TAG should contain an User Comment. So some textual note about the image. – AndreaF Jun 27 '19 at 17:22
  • How is that tag being set? http://metapicz.com also shows the same tag content, so that image really has that tag, and you would need to ask whoever is creating the tag how to decode it. – CommonsWare Jun 27 '19 at 17:24
  • @CommonsWare I don't know. Isn't there some way to detect the String encoding used? Exif is a standardized format so I guess the encoding that could be used should be limited. – AndreaF Jun 27 '19 at 17:33
  • My guess is that the User Comment tag can be anything. However, your question suggests that the problem is with `ExifInterface`, and that is not the case. – CommonsWare Jun 27 '19 at 17:38
  • I have edited the question. – AndreaF Jun 27 '19 at 17:45

0 Answers0