Skip to content

Instantly share code, notes, and snippets.

@minexew
Created July 29, 2014 20:45
Show Gist options
  • Save minexew/1dfda292ef325d933c54 to your computer and use it in GitHub Desktop.
Save minexew/1dfda292ef325d933c54 to your computer and use it in GitHub Desktop.
/gd/ is pretty cool
# usage: fixheader.py <valid_bmp> <file_to_fix>
HEADER_SIZE = 54
import sys
header = sys.argv[1]
fileName = sys.argv[2]
with open(header, 'rb') as input, open(fileName, 'rb+') as output:
data = input.read(HEADER_SIZE)
output.write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment