internetarchive / internetarchive/openlibrary
Error when attempting to upload webp as cover
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
### Problem
OL lets you upload webp images, but then fails with "Unable to render this page."

This appears to be a separate issue from #7250
### Reproducing the bug
1. On an edition, select 'Manage Covers'
2. Select 'Choose File'
3. From the system image picker, choose a webp image
* Expected behaviour:
OL either supports upload of webp images, or prevents uploading them in the first place
* Actual behaviour:
The generic error "Unable to render this page." is displayed in the cover management modal.
The main page also displays the error message `/openlibrary/openlibrary/templates/covers/add.html: error in processing template: AttributeError: 'code' (falling back to default template)`.
### Context
- Browser (Chrome, Safari, Firefox, etc): Safari
- OS (Windows, Mac, etc): iPadOS 18.2
- Logged in (Y/N): Y
- Environment (prod, dev, local): prod
### Breakdown
#### Requirements Checklist
* [ ]
#### Related files
*
#### Stakeholders
*
#### Instructions for Contributors
- Please [run these commands](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#working-on-your-branch) to ensure your repository is up to date **before** [creating a new branch](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#making-changes-and-creating-a-pull-request) to work on this issue and **each time after** pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Contributor guide
Assessment
This issue has not been assessed yet.