How does JPEG endianness matter on coding?

后端 未结 2 982
一整个雨季
一整个雨季 2020-12-31 14:48

I\'m currently working on a big project that involve pictures. One of the big issues I\'m having is with the endianness of the picture (jpeg to be clearer). I always though

相关标签:
2条回答
  • 2020-12-31 15:13

    Ok so I found my answer by asking question to Phil, the author of exiftool

    You can see the thread I had with him here.

    1. Yes it's possible. The 3rd party SDK was not aware that the exif header could be encoded using little-endian or big-endian and was only reading using little-endian. Changing all my picture to little-endian fixed the problem.
    2. 2 parts answer: First, the data of a jpeg is always big endian as said in my edit. Second, the exif header can be in either little-endian or big-endian and it's possible to change it using exiftool.

    In command line:

    exiftool -all= -tagsfromfile test.jpg -all:all -unsafe -exifbyteorder=little-endian test.jpg

    You can also found a wrapper for the tool in almost any language in this page.

    Thanks a lot for your interest in the question and the answer I received.

    0 讨论(0)
  • 2020-12-31 15:24

    I think maybe the problem is with the user comment field. I read somewhere that Windows Vista (and probably windows 7) saves the user comment field as Unicode in little-endian byte order, irrespective of the byte ordering of the EXIF information. Since the only difference between PictureXP and Picture7 is the endianness of the exif information and the user comment field, maybe you should look that way

    Good luck

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