You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm working with the Shrine gem and uploading PDF files to S3 (direct upload).
During the upload, the code is adding some metadata such as the page count.
I noticed that PDF::Reader accepts IO objects as input, but it's not working with the Down::ChunkedIOclass.
This is the code from the shrine uploader:
add_metadata do |file, metadata:, record:, **|
case metadata["mime_type"]
when "application/pdf"
io = file.to_io if file.respond_to?(:to_io)
reader = PDF::Reader.new(io)
{ page_count: reader.page_count }
Exception:
ArgumentError: input must be an IO-like object or a filename (Down::ChunkedIO)
Code from PDF::Reader that will try to read the IO object.
Hi,
I'm working with the Shrine gem and uploading PDF files to S3 (direct upload).
During the upload, the code is adding some metadata such as the page count.
I noticed that PDF::Reader accepts IO objects as input, but it's not working with the
Down::ChunkedIO
class.This is the code from the shrine uploader:
Exception:
Code from PDF::Reader that will try to read the IO object.
pdf-reader/lib/pdf/reader/object_hash.rb
Line 601 in 625e8dc
Is it possible to PDF::Reader to support
Down::ChunkedIO
?Any thoughts?
Thank you.
The text was updated successfully, but these errors were encountered: