Skip to content

Commit

Permalink
[fix] overwrite flag and more log
Browse files Browse the repository at this point in the history
  • Loading branch information
NatLee committed Oct 11, 2023
1 parent 4e301d2 commit d36846f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/heic2png/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import argparse
from pillow_heif import register_heif_opener

from . import __version__
from .heic2png import HEIC2PNG

def cli(args):
Expand All @@ -18,7 +20,15 @@ def cli(args):
return

try:
heic_img = HEIC2PNG(args.input_path, args.quality)
print('==========================')
print('==== HEIC2PNG Options ====')
print('==========================')
print(f'>> Input file path: {args.input_path}')
print(f'>> Output file path: {args.output_path}')
print(f'>> Quality: {args.quality}')
print(f'>> Overwrite: {args.overwrite}')
print('==========================')
heic_img = HEIC2PNG(args.input_path, args.quality, args.overwrite)
print('Converting the image...')

if args.output_path and args.overwrite:
Expand All @@ -45,6 +55,8 @@ def main():
"""
register_heif_opener()

print(f'HEIC2PNG v{__version__}')

parser = argparse.ArgumentParser(description="Convert HEIC images to PNG.")
parser.add_argument("-i", "--input_path", required=True, help="Path to the input HEIC image.")
parser.add_argument("-o", "--output_path", help="Path to save the converted PNG image.")
Expand Down

0 comments on commit d36846f

Please sign in to comment.