17 lines
377 B
Python
Executable File
17 lines
377 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from pathlib import Path
|
|
|
|
def main():
|
|
with (Path(__file__).parent / "file").open('rb') as file:
|
|
content = file.read()
|
|
|
|
JFIF_MAGIC_BYTES = b"\xFF\xD8"
|
|
new_content = JFIF_MAGIC_BYTES + content[2:]
|
|
|
|
with (Path(__file__).parent / "file.jpg").open('wb') as file:
|
|
file.write(new_content)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|