I created a program that according to a string it creates a BMP file.
On a slackware machine:
- i686;
- little endian;
- lang = en_US;
The image is generated perfectly with the result of file img.bmp being:
- 'img.bmp: PC bitmap, Windows 3.x format, 168 x -168 x 24'
And the result of file -si img.bmp being:
- 'img.bmp: image/x-ms-bmp; charset=binary'
On a Xubuntu:
- i686;
- little endian;
- lang = en_US;
The image is corrupt with 2 more bytes than the working one and file img.bmp gives:
- 'img.bmp: data'
And file -si img.bmp gives:
- 'img.bmp: application/octet-stream; charset=binary'...
Both the source files are in 'ASCII text'.
The encoding of the working binary executable is:
- 'ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped'.
The encoding of working binary executable (but generates corrupt image) is:
- 'ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=07dc7b384509e7a6b2d1f87460998b00fe050866, not stripped'.
I'm trying to understand why I can view the image generated on my slackware VM but I can't view it on Xubuntu...