Skip to content

Commit

Permalink
Export EXIF metadata (#9)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Florian Schüller <[email protected]>
  • Loading branch information
NeverMendel and schuellerf authored Oct 17, 2023
1 parent 48c3410 commit 84cc66b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion heif_convert/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ def parse_args():
help="output quality, integer [0, 100] (default: 90)",
default=90,
)
parser.add_argument(
"-n",
"--no-exif",
dest="exif",
action="store_false",
help="Do not include EXIF metadata in the converted image",
)
parser.add_argument(
"-v",
"--verbose",
Expand Down Expand Up @@ -119,7 +126,10 @@ def main():
output_filename,
)
logging.info(f"Writing {output_filepath}")
image.save(output_filepath, quality=args.quality)
if args.exif:
image.save(output_filepath, quality=args.quality, exif=image.getexif())
else:
image.save(output_filepath, quality=args.quality)
print(f"Wrote {output_filepath}")


Expand Down

0 comments on commit 84cc66b

Please sign in to comment.