fixed a potential endless loop if the image had a lot of metadata
This commit is contained in:
parent
8db04fa526
commit
0ff526b5ca
1 changed files with 1 additions and 1 deletions
2
bcao.py
2
bcao.py
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue