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

landing page: png preview not working #179

Open
ppanero opened this issue Jul 22, 2021 · 0 comments
Open

landing page: png preview not working #179

ppanero opened this issue Jul 22, 2021 · 0 comments
Assignees

Comments

@ppanero
Copy link
Member

ppanero commented Jul 22, 2021

After some investigation it boils down to the validation function of simple_image:

(Pdb) l
 18
 19
 20  	def validate(file):
 21  	    """Validate a simple image file."""
 22  	    max_file_size = current_app.config.get(
 23  ->	        "PREVIEWER_MAX_IMAGE_SIZE_BYTES", 0.5 * 1024 * 1024
 24  	    )
 25  	    return file.size <= max_file_size
 26
 27
 28  	def can_preview(file):
(Pdb) n
> /Users/ppanero/.virtualenvs/v5/lib/python3.7/site-packages/invenio_previewer/extensions/simple_image.py(25)validate()
-> return file.size <= max_file_size
(Pdb) max_file_size
524288.0
(Pdb) file.size
973107.0
@ppanero ppanero self-assigned this Jul 23, 2021
@ppanero ppanero transferred this issue from inveniosoftware/invenio-previewer Jul 23, 2021
@ppanero ppanero removed their assignment Jul 23, 2021
@ppanero ppanero assigned lnielsen and unassigned ppanero Jul 23, 2021
@lnielsen lnielsen added this to Triage in InvenioRDM September via automation Sep 1, 2021
@lnielsen lnielsen moved this from Triage to Blocked in InvenioRDM September Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants