-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add prawn-gmagick gem #121
Comments
Looking forward to this, PDF conversion can be sometimes significantly slow 😄 |
While writing tests, I've noticed that prawn-gmagick can mess up the
palette of some PNGs. I'm not sure how prevalent this problem is, but we
may need to provide an escape hatch (in Asciidoctor PDF) so it doesn't get
automatically loaded if it is a real problem.
|
In a container of this image, apk add graphicsmagick-dev ruby-dev musl-dev gcc
gem install prawn-gmagick As documented at https://github.com/asciidoctor/asciidoctor-pdf#supporting-additional-image-file-formats, |
Tried to embed image in PDF. Source is a URL (e.g. https://img.shields.io/badge/Status-Open-red). But get the warning "asciidoctor: WARNING: could not embed image: /tmp/image-20200813-1-1h5my3o; image file is an unrecognised format; install prawn-gmagick gem to add support" after enable the attribute allow-uri-read. |
I see, after testing to load the missing packages it isn't an issue with the package. I get the same error. |
The warning message is unrelated to the problem in this case. You have specified a path to an SVG, but not indicated that it's an SVG. You can do so by appending .svg to the URL or adding the format=svg attribute to the macro. |
Asciidoctor PDF 2 will provide a script you can use to prevent prawn-gmagic from handling PNG images in this situation.
It still leaves prawn-gmagick enabled for other image formats since they wouldn't otherwise be supported. |
I would like to see this added to the base docker image. I see the instructions but we are using this in an offline environment and it can't download and install it dynamically. |
This is now implemented, so it's safe to add this gem to the image. See https://docs.asciidoctor.org/pdf-converter/latest/image-paths-and-formats/#unregister-prawn-gmagick |
The prawn-gmagick gem is a drop-in replacement for the image processing in Asciidoctor PDF that uses GraphicsMagick under the covers. It has the benefit of making PDF conversion of documents containing images substantially faster. Image decoding in pure Ruby is quite slow, so this gem delegates the work to GraphicsMagick to speed it up. It also adds support for more image formats, like GIF. The downside is that it also requires the GraphicsMagick package to be installed. If it doesn't add too much to the size of the image (at least the box image), I think it is well worth adding.
See https://github.com/asciidoctor/asciidoctor-pdf#supporting-additional-image-file-formats
The text was updated successfully, but these errors were encountered: