mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-26 15:06:36 +00:00
Merge pull request #957 from tcely/patch-16
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Do not call `resize_image_to_height` on smaller images
This commit is contained in:
commit
15a9537b0e
@ -510,9 +510,10 @@ def download_media_thumbnail(media_id, url):
|
|||||||
width = getattr(settings, 'MEDIA_THUMBNAIL_WIDTH', 430)
|
width = getattr(settings, 'MEDIA_THUMBNAIL_WIDTH', 430)
|
||||||
height = getattr(settings, 'MEDIA_THUMBNAIL_HEIGHT', 240)
|
height = getattr(settings, 'MEDIA_THUMBNAIL_HEIGHT', 240)
|
||||||
i = get_remote_image(url)
|
i = get_remote_image(url)
|
||||||
log.info(f'Resizing {i.width}x{i.height} thumbnail to '
|
if (i.width > width) and (i.height > height):
|
||||||
f'{width}x{height}: {url}')
|
log.info(f'Resizing {i.width}x{i.height} thumbnail to '
|
||||||
i = resize_image_to_height(i, width, height)
|
f'{width}x{height}: {url}')
|
||||||
|
i = resize_image_to_height(i, width, height)
|
||||||
image_file = BytesIO()
|
image_file = BytesIO()
|
||||||
i.save(image_file, 'JPEG', quality=85, optimize=True, progressive=True)
|
i.save(image_file, 'JPEG', quality=85, optimize=True, progressive=True)
|
||||||
image_file.seek(0)
|
image_file.seek(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user