Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add webp support to coverstore #10382

Merged
merged 1 commit into from
Jan 29, 2025
Merged

add webp support to coverstore #10382

merged 1 commit into from
Jan 29, 2025

Conversation

RayBB
Copy link
Collaborator

@RayBB RayBB commented Jan 23, 2025

Part of #7250

Turns out with PIL webp just works. No changes needed other than allowing the format.

Unfortunately, AVIF support just isn't there yet :/
python-pillow/Pillow#7983

Technical

Testing

Upload a cover that's webp, like: https://www.gstatic.com/webp/gallery/1.webp

Screenshot

Stakeholders

@cdrini

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! We tested uploading on testing, and everything seemed to work smoothly -- although note our testing environment might not be testing the entire flow, since it does just connect to prod's coverstore.

We did notice, that the original size is saved to disk as a .jpg, but the actual binary is a WEBP -- this appears to affect all non-jpg uploads, eg PNG, GIF. It doesn't seem to cause any issues, though so seems ok?

$/var/lib/openlibrary/coverstore/localdisk/2025/01/29$ ls | grep OL54067000M
OL54067000M-60P4k-L.jpg
OL54067000M-60P4k-M.jpg
OL54067000M-60P4k-S.jpg
OL54067000M-60P4k.jpg
$/var/lib/openlibrary/coverstore/localdisk/2025/01/29$ ls -al | grep OL54067000M
-rw-r--r--  1 openlibrary openlibrary   30272 Jan 29 17:27 OL54067000M-60P4k-L.jpg
-rw-r--r--  1 openlibrary openlibrary   11968 Jan 29 17:27 OL54067000M-60P4k-M.jpg
-rw-r--r--  1 openlibrary openlibrary    1602 Jan 29 17:27 OL54067000M-60P4k-S.jpg
-rw-r--r--  1 openlibrary openlibrary   57262 Jan 29 17:27 OL54067000M-60P4k.jpg
$/var/lib/openlibrary/coverstore/localdisk/2025/01/29$ head -b32 OL54067000M-60P4k.jpg
head: invalid option -- 'b'
Try 'head --help' for more information.
$/var/lib/openlibrary/coverstore/localdisk/2025/01/29$ head -c32 OL54067000M-60P4k.jpg
RIFF□□WEBPVP8X
 □□IC
 
$/var/lib/openlibrary/coverstore/localdisk/2025/01/29$ head -c32 OL54067000M-60P4k-L.jpg
□□□□JFIF□□C

@cdrini cdrini merged commit 4f0aa02 into master Jan 29, 2025
7 checks passed
@cdrini cdrini deleted the webp-support branch January 29, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants