Page 1 of 1

Command line removal header byes from files

Posted: 16 Apr 2020 16:07
by guyp
Dear Maƫl:

On importing certain jpeg files from a MAC OS to a WINDOWS OS, the files are unviewable due to the MAC header information put in front of the jpeg image file. If I remove that header using HxD, then the file becomes viewable in various WINDOWS image displayers and editors. In those jpg files I have 'fixed', the MAC header is 460 bytes long, and is followed by the standard jpeg four-byte initial string FF D8 FF E0, often used by image viewers to verify that the following bytes are a jpeg image.

I have hundreds of such MAC files needing conversion, so manual editing with HxD is prohibitively time consuming.

Therefore, I request a command line option which splits a file into two at a specific point and then writes the first, the second, or both segments back to disk as separate new files. This would allow automation in a WINDOWS batch file.

My regards for creating such an excellent program.

guyp

Re: Command line removal header byes from files

Posted: 24 Apr 2020 13:56
by Efcis
Hi guyp

You could try the dd utility (also available for win32 : https://sourceforge.net/projects/unxutils/)

dd if=inputFile.jpg of=outputFile.jpg bs=1 skip=460

It might be possible to write a batch file to execute this command for all your files in one go.