aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/embedthumbnail.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/postprocessor/embedthumbnail.py')
-rw-r--r--yt_dlp/postprocessor/embedthumbnail.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py
index 2d4f42a20..b0372225a 100644
--- a/yt_dlp/postprocessor/embedthumbnail.py
+++ b/yt_dlp/postprocessor/embedthumbnail.py
@@ -77,11 +77,14 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
original_thumbnail = thumbnail_filename = info['thumbnails'][-1]['filepath']
- # Convert unsupported thumbnail formats to JPEG (see #25687, #25717)
+ # Convert unsupported thumbnail formats to PNG (see #25687, #25717)
+ # Original behavior was to convert to JPG, but since JPG is a lossy
+ # 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'):
- thumbnail_filename = convertor.convert_thumbnail(thumbnail_filename, 'jpg')
- thumbnail_ext = 'jpg'
+ thumbnail_filename = convertor.convert_thumbnail(thumbnail_filename, 'png')
+ thumbnail_ext = 'png'
mtime = os.stat(encodeFilename(filename)).st_mtime