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

Can't upload multi-page PDFs #68

Open
wilsonmcdade opened this issue Apr 16, 2020 · 3 comments
Open

Can't upload multi-page PDFs #68

wilsonmcdade opened this issue Apr 16, 2020 · 3 comments

Comments

@wilsonmcdade
Copy link

Attemping to upload a multi-page PDF gives an error for the user.

@mxmeinhold
Copy link
Contributor

I'm seeing this when I upload PDFs, so it appears like it might be an issue with thumbnail generation.

  File "gallery/__init__.py", line 181, in upload_file
    file_model = add_file(filename, dir_path, parent, "", owner)
  File "gallery/__init__.py", line 371, in add_file
    file_data = parse_file_info(file_path, path)
  File "gallery/file_modules/__init__.py", line 95, in parse_file_info
    return file_mimetype_relation[mime_type](file_path, dir_path)
  File "gallery/file_modules/pdf.py", line 10, in __init__
    self.generate_thumbnail()
  File "gallery/file_modules/__init__.py", line 43, in generate_thumbnail
    background=Color("#EEEEEE")) as bg:
  File "/usr/local/lib/python3.7/site-packages/wand/image.py", line 4612, in __init__
    self.blank(width, height, background)
  File "/usr/local/lib/python3.7/site-packages/wand/image.py", line 4671, in blank
    repr(width))
TypeError: width must be a natural number, not 0

We might need to do an additional check to handle pdfs, but I haven't played with wand enough to really make any comments.

@jabbate19
Copy link
Contributor

I believe this is solved? https://gallery.csh.rit.edu/view/dir/833 works fine

@mxmeinhold
Copy link
Contributor

This issue is about uploads, not viewing? Those PDFs are older than this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants