-
Notifications
You must be signed in to change notification settings - Fork 62
-
It would be fantastic if the thumbnail method would accept :dpi and :page options in order to fully support rendering of thumbnails from PDF files.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments
-
Hi, you can put page into the filename, eg.:
vips thumbnail nip2guide.pdf[page=12] -o x.jpg
I agree having a proper page parameter would be simpler.
You're right, you can't use dpi to size thumbnails, you can only give a size in pixels. You can calculate a pixel size from the image xres and your desired DPI, of course.
I'm not certain that sizing by DPI is very useful. Many PDFs have strange values set for DPI and you could get almost any size thumbnail as a result.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi John, thanks for reply.
I think it would be great if the api would be same as for .new_from_file here eventually.
As for dpi – I assumed that when supplied as input option the PDF is internally rasterised to that DPI and then scaled down with for example the .resize. It would be great if .thumbnail works the same so that we do not need to run it twice – once to generate large version from PDF, second time to scale it down to actual thumbnail.
(For now, I went back to the .resize method in dragonfly_libvips because using the .thumbnail breaks all PDF rasterisation – ie the images have correct pixel size but appear low-res, pixellated.)
Beta Was this translation helpful? Give feedback.
All reactions
-
thumbnail just rasterises the PDF at the exact size you ask for. It gives nice results for me, for example the ISO res chart:
vipsthumbnail ISO_12233-reschart.pdf
Gives:
Do you have an example of a PDF that fails to rasterise well?
Beta Was this translation helpful? Give feedback.