Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VipsForeignLoad error converting PDF to PNG #9

Closed
jonsgreen opened this issue Oct 5, 2020 · 1 comment
Closed

VipsForeignLoad error converting PDF to PNG #9

jonsgreen opened this issue Oct 5, 2020 · 1 comment

Comments

@jonsgreen
Copy link

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
Copy link
Author

jonsgreen commented Oct 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants