gallery icon indicating copy to clipboard operation
gallery copied to clipboard

Can't upload multi-page PDFs

Open wilsonmcdade opened this issue 5 years ago • 3 comments

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

wilsonmcdade avatar Apr 16 '20 06:04 wilsonmcdade

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.

mxmeinhold avatar Apr 20 '20 17:04 mxmeinhold

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

jabbate19 avatar Mar 28 '22 18:03 jabbate19

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

mxmeinhold avatar Mar 31 '22 03:03 mxmeinhold