fixed a potential endless loop if the image had a lot of metadata

This commit is contained in:
Lynne Megido 2019-12-16 21:57:55 +10:00
parent 8db04fa526
commit 0ff526b5ca
Signed by: lynnesbian
GPG key ID: FB7B970303ACE499

View file

@ -105,7 +105,7 @@ if cover == "":
while os.path.getsize(cover) / 1024 > args.threshold: while os.path.getsize(cover) / 1024 > args.threshold:
if os.path.basename(cover) != "cover-lq.jpg": if os.path.basename(cover) != "cover-lq.jpg":
nucover = os.path.dirname(cover) + os.sep + "cover-lq.jpg" nucover = os.path.dirname(cover) + os.sep + "cover-lq.jpg"
subprocess.check_output(["convert", cover, "-quality", "85", nucover]) #convert the file to a jpeg subprocess.check_output(["convert", cover, "-quality", "85", "-strip", nucover]) #convert the file to a jpeg
cover = nucover cover = nucover
else: else:
subprocess.check_output(["convert", cover, "-resize", "90%", cover]) #shrink it slightly subprocess.check_output(["convert", cover, "-resize", "90%", cover]) #shrink it slightly