Newlywords / heroku-buildpack-vips

Heroku buildpack with vips and pdf support via poppler
MIT License
38 stars 83 forks source link

VipsForeignLoad error converting PDF to PNG #9

Closed jonsgreen closed 3 years ago

jonsgreen commented 4 years ago

I have been trying to use vips on heroku with this buildpack but I have been running into issues that I don't experience when running locally. I am trying to convert a pdf to a png and doing it from memory. I get this error:

Vips::Error (VipsForeignLoad: source is not in a known format)

It happens while running the following ruby code:

source = Vips::Source.new_from_memory(generate)
preview = Vips::Image.new_from_source(source, "")

I am thinking that perhaps there isn't the correct library installed for doing this conversion?

Locally I am running vips 8.10.1 but on heroku I seem to only be able to run 8.9.2 even if I set a VIPS_VERSION config var to 8.10.1.

I apologize for my ignorance with the low level code and installations going on to make all this magic happening. I was hoping that you might have more experience to point me in the right direction.

jonsgreen commented 4 years ago

In the end I figured out that it was easier to store the pdf and then generate a preview using Rails ActiveStorage and the official buildpack for pdf previewing supplied by Heroku: https://devcenter.heroku.com/articles/active-storage-on-heroku?preview=1#attachment-previews.

You are welcome to respond but otherwise you can close this issue. Thanks.