How does JPEG endianness matter on coding?

后端 未结 2 993
一整个雨季
一整个雨季 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条回答
  •  萌比男神i
    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.

提交回复
热议问题