gallery
gallery copied to clipboard
Can't upload multi-page PDFs
Attemping to upload a multi-page PDF gives an error for the user.
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.
I believe this is solved? https://gallery.csh.rit.edu/view/dir/833 works fine
This issue is about uploads, not viewing? Those PDFs are older than this issue.