internetarchive / internetarchive/openlibrary
Fix image previews for works and edition pages on Facebook and twitter
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
Followup for #3212
- Most of the previews were showing up but sometimes without an image
- If an image does not show up in a preview this may be due the image size not being sufficient.
- Facebook demands The URL of the image for your object. It should be at least 600×315 pixels, but 1200×630 or larger is preferred (up to 5MB). Stay close to a 1.91:1 aspect ratio to avoid cropping.
- Twitter demands A URL to a unique image representing the content of the page. You should not use a generic image such as your website logo, author photo, or other image that spans multiple pages. Images for this Card support an aspect ratio of 1:1 with minimum dimensions of 144x144 or maximum of 4096x4096 pixels. Images must be less than 5MB in size. The image will be cropped to a square on all platforms. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported.
- Previews for home page is fixed -> Pr #3462
- For image previews we would need to increase the resolution of covers which will automatically fix things
- Works page with a lot of editions previews fails to load with a timeout error
### Evidence / Screenshot (if possible)
[Audit Spreadsheet](https://docs.google.com/spreadsheets/d/17r-1yZBaD2rbpxCwvBWjIAZVzuEUaN7wnHrRjFOseSA/edit?usp=sharing)
### Proposal & Constraints
https://github.com/internetarchive/openlibrary/blob/0af1e20c1abd3efcc0755a2d39868709a878fe64/openlibrary/templates/type/list/view.html#L175 - Maybe here we can change the `M` -> `L` to fetch large covers for previews
### Related files
### Stakeholders
Contributor guide
Assessment
This issue has not been assessed yet.