-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
Hello, first of all i want to thank you for your work with this gem.
I'm opening this issue in the hopes of opening a discussion as to why this is happening or at least get some guidance of what I'm doing wrong.
Right now, what I'm trying to achieve, is converting each the pages of a remote pdf to png,
for that, currently im doing this:
pdf_blob = open(pdf_url).read;
pdf_pages = Magick::ImageList.new.from_blob(pdf_blob) {
self.density = 200
}.to_a.map { |page|
page.to_blob { format = 'PNG' }
}I have tried several different approachs to accomplish the task:
- Trying to set the format in the options block from the
#from_blobmethod call - Calling collect after calling the the
#from_blobmethod and callingto_blobon each page.
The last one brings me to the question: Why doesnt '#collect' mimic the api set by Enumerable? it returns an ImageList instead, and doesn't let us do something like:
Magick::ImageList.new.from_blob(pdf_blob) {self.density = 200}.collect { |page| page.to_blob { format = 'PNG'} } seems like a waste of resources.
MatzFan
Metadata
Metadata
Assignees
Labels
No labels