h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
https://fly.io/docs/app-guides/run-a-global-image-service/
MIT License
5.51k stars 456 forks source link

Specifying DPI when reading PDFs #170

Open hirish opened 6 years ago

hirish commented 6 years ago

Hey,

Unfortunately, it's not possible to specify the resolution to read a PDF at.

The libvips PDF Load method allows for specifying DPI: https://github.com/jcupitt/libvips/blob/master/libvips/foreign/pdfload.c

But it looks like Bimg/imaginary don't support passing through this property. This makes it impossible to use imaginary to convert scanned PDFs at a reasonable quality.

Thanks!

h2non commented 6 years ago

Yeah, this is something that needs to be supported in bimg first. It should be easy. Are you interested in providing a PR?

rainerCH commented 4 years ago

Hi @h2non

first thank you for all your work on imaginary :-) is there any plan to implement this feature? maybe we can just increment the default DPI in a first step?

Thanks! Rainer

hirish commented 4 years ago

@rainerCH I scratched my own itch here: https://github.com/hirish/imaginary (although it's probably now quite behind). Unfortunately my go knowledge isn't strong enough to know how to go about implementing a properly tested PR.