[thumbnailsconvertor] Treat jpeg as jpg

This commit is contained in:
pukkandan 2021-06-25 05:36:35 +05:30
parent 4513a41a72
commit 15a4fd53d3
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698
2 changed files with 3 additions and 1 deletions

View File

@ -92,7 +92,7 @@ def run(self, info):
# format, there will be some additional data loss.
# PNG, on the other hand, is lossless.
thumbnail_ext = os.path.splitext(thumbnail_filename)[1][1:]
if thumbnail_ext not in ('jpg', 'png'):
if thumbnail_ext not in ('jpg', 'jpeg', 'png'):
thumbnail_filename = convertor.convert_thumbnail(thumbnail_filename, 'png')
thumbnail_ext = 'png'

View File

@ -896,6 +896,8 @@ def run(self, info):
_, thumbnail_ext = os.path.splitext(original_thumbnail)
if thumbnail_ext:
thumbnail_ext = thumbnail_ext[1:].lower()
if thumbnail_ext == 'jpeg':
thumbnail_ext = 'jpg'
if thumbnail_ext == self.format:
self.to_screen('Thumbnail "%s" is already in the requested format' % original_thumbnail)
continue