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

Error when attempting to upload webp as cover #10086

Open
zorae opened this issue Nov 26, 2024 · 5 comments · May be fixed by #10009
Open

Error when attempting to upload webp as cover #10086

zorae opened this issue Nov 26, 2024 · 5 comments · May be fixed by #10009
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Response Issues which require feedback from lead Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]

Comments

@zorae
Copy link

zorae commented Nov 26, 2024

Problem

OL lets you upload webp images, but then fails with "Unable to render this page."

IMG_0171

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 to ensure your repository is up to date before creating a new branch 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.
@zorae zorae added Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed] labels Nov 26, 2024
@Spaarsh
Copy link
Contributor

Spaarsh commented Nov 30, 2024

@zorae I am unable to replicate this issue. I don't see any webp image (for the developer version as well as on the website) when I try the Choose File option. The html form in add.html#52 has the accept attribute set as follows accept = ".jpg, .jpeg, .gif, .png" So this limits the files visible at the time of choosing to .jpg, .jpeg, .gif and .png formats.

@zorae
Copy link
Author

zorae commented Nov 30, 2024

@Spaarsh in that case, the photo picker on iOS/iPadOS 18 seems to implement this incorrectly.

@Spaarsh
Copy link
Contributor

Spaarsh commented Nov 30, 2024

I was not able to find any recent instances of the accept attribute not working on iOS/iPadOS devices. There is this, this and this thread that indicate a history of unexpected behavior with HTML forms. If we can ensure that is a Safari/iOS/iPadOS issue then we can write alternative code that uses onChange handler as shown in the first thread. But even before that, we can write the error handling code so that the user doesn't get to see this error.

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Dec 1, 2024
@mekarpeles mekarpeles added Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] and removed Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] labels Dec 2, 2024
@jimchamp jimchamp linked a pull request Dec 5, 2024 that will close this issue
@jimchamp
Copy link
Collaborator

jimchamp commented Dec 5, 2024

As pointed out here, Open Library only accepts GIF, JPEG, or PNG image types. However, if an image file fails to pass validation, Unable to render this page should not appear in the upload modal.

PR #10009, when merged, will fix rendering error and display a message when image validation fails:
Screenshot 2024-11-07 171051.

@jimchamp jimchamp removed the Needs: Response Issues which require feedback from lead label Dec 5, 2024
@raissg
Copy link

raissg commented Dec 11, 2024

Hello, we are a group of university students, and as part of our project, we are contributing to open-source repositories. We would really like to work on this issue, and since our project deadline is approaching, we are eager to get started as soon as possible. Could we please be assigned to this issue? We’ll make sure to follow all contributing guidelines and complete the work on time. Thank you for considering us!

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Needs: Breakdown This big issue needs a checklist or subissues to describe a breakdown of work. [managed] Needs: Response Issues which require feedback from lead Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants