Skip to content

Can't upload multi-page PDFs #68

Description

@wilsonmcdade

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

Activity

  1. mxmeinhold commented on Apr 20, 2020

    @mxmeinhold
    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.

  2. jabbate19 commented on Mar 28, 2022

    @jabbate19
    Contributor

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

  3. mxmeinhold commented on Mar 31, 2022

    @mxmeinhold
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions