2

I tried to compress a gif image with LZ4. The results seem to differ in the header for Linux wml and Windows in the first 77 bytes, the rest of the file is identical. I ran the same code in both cases. Linux WML also has 2 bytes more than windows. Can someone explain this difference. The usual header seems much smaller than those 77 bytes.

First bytes of Linux results compression:

C2 47 49 46 38 37 61 E0 01 68 01 E7 00 01 00 42 08 73 FF 10 0A 00 0F 02 00 FF FF E0 F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 4D 2C 00 00 00 00 E0 01 68 01 00 08

First bytes of Windows results compression:

C2 47 49 46 38 37 61 E0 01 68 01 E7 00 01 00 42 08 73 FF 10 0A 00 0F 02 00 FF FF E0 10 2C F2 02 00 0C 03 F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 44 00 08

I also tried a txt file and here i also found a two bytes difference in the linux wml and windows result

Meng
  • 191
  • 9
  • 2
    LZ4 is a compression algorithm, not a file format. Whatever bytes are on file depends on the program that created the files. – Some programmer dude Dec 07 '21 at 11:08
  • Does that also apply for the header data? – Meng Dec 07 '21 at 11:20
  • 1
    File format is usually disconnected from the algorithms used to create data. Are you writing the program that created the files? Or are you creating a program that should read the files? If you're reading the file only, what programs was used to create the files? If you created the program to write the files, how did you write them? What is your file format? What is your "header"? – Some programmer dude Dec 07 '21 at 11:24
  • How were these constructed? None of the bytes you show have the LZ4 magic number _anywhere_ in there. The magic number, `04 22 4d 18`, appears at the start of every LZ4 stream. – Mark Adler Dec 07 '21 at 17:18

0 Answers0