Skip to content

delegate library support not built-in #6

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

Closed
trungegd opened this issue Nov 6, 2019 · 9 comments
Closed

delegate library support not built-in #6

trungegd opened this issue Nov 6, 2019 · 9 comments

Comments

@trungegd
Copy link

trungegd commented Nov 6, 2019

I just create lambda function and used this layer. But when I add font for text in image, I get an error:

{ Error: Command failed: convert: delegate library support not built-in '/tmp/fonts/Archer-Bold.ttf' (Freetype) @ warning/annotate.c/RenderFreetype/1808. convert: non-conforming drawing primitive definition 'text' @ error/draw.c/RenderMVGContent/4397. at ChildProcess.<anonymous> (/var/task/node_modules/imagemagick/imagemagick.js:88:15) at ChildProcess.emit (events.js:198:13) at ChildProcess.EventEmitter.emit (domain.js:448:20) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) timedOut: false, killed: false, code: 1, signal: null }

My params: -size,863x875,xc:transparent,(,-fill,#231f20,-size,391.8412x245.1814,xc:transparent,-font,/tmp/fonts/Archer-Bold.ttf,-pointsize,22.152,-stroke,none,-draw,gravity center kerning 0 text 0,0 "I love you so",-background,none,-rotate,0.00,),-geometry,+228.4788+551.5006,-composite,/tmp/images/gexqcZl7zU.png

Can you detect for me about to solve it.

@gojko
Copy link
Contributor

gojko commented Nov 6, 2019

to keep the layer size small, the default includes a minimal set of libraries, for most common image formats. it does not include freetype, so you'll need to change the makefile and add it in. You can probably copy the necessary parts from the https://github.com/serverlesspub/rsvg-convert-aws-lambda-binary layer makefile, since it bundles freetype

@gojko gojko closed this as completed Nov 6, 2019
@lambtron
Copy link

thank you @gojko for putting this together. makes using imagemagick and lambda very easy.

i also need freetype in my lambda, and putting it in the layer makes the most sense.

i added the freetype download and installation in the make file, but i'm getting this error when i try make all and make deploy:

MagickCore/annotate.c:89:10: fatal error: ft2build.h: No such file or directory
 #include <ft2build.h>
          ^~~~~~~~~~~~
compilation terminated.

looks like the path isn't set properly for freetype, but i'm at a loss as to what it should be. looks like my configure variable is set correctly.

here is my version:
https://github.com/lambtron/imagemagick-aws-lambda-2/blob/master/Makefile_ImageMagick#L116

and the commit so you can see the changes: lambtron@bbb76bb

any thoughts as to what might be causing this issue?

thanks again!!

@lambtron
Copy link

i got it to work. i copied the entire section from the rsvg including harfbuzz. THANK YOU!

@trungegd
Copy link
Author

trungegd commented Nov 14, 2019

to keep the layer size small, the default includes a minimal set of libraries, for most common image formats. it does not include freetype, so you'll need to change the makefile and add it in. You can probably copy the necessary parts from the https://github.com/serverlesspub/rsvg-convert-aws-lambda-binary layer makefile, since it bundles freetype

@gojko Thanks so much. It works fine for me.
Here is my Makefile_ImageMagick file:

Makefile_ImageMagick.txt

@jugglingcats
Copy link

@lambtron or @trungegd would you be willing to post your layer so others can use it? I need freetype and I'm sure others would benefit.

@jugglingcats
Copy link

jugglingcats commented Dec 7, 2019

@trungegd am trying to use your make file (on Ubuntu with Docker installed) but get the following error:

/var/task/build/fontconfig-2.13.0/missing: line 81: gperf: command not found
WARNING: 'gperf' is missing on your system.
         You might have modified some files without having the proper
         tools for further handling them.  Check the 'README' file, it
         often tells you about the needed prerequisites for installing
         this package.  You may also peek at any GNU archive site, in
         case some other package contains this missing 'gperf' program.

Tried installing on the host Ubuntu but same error so I assume this is missing in Docker...?

UPDATE 1: used workaround in #10 and build completes now -- getting there!

UPDATE 2: have successfully built and deployed layer.zip using makefile from @trungegd but still no text :(

UPDATE 3: added a ttf to layer and used full path in gm.font and 🎉!

@trungegd
Copy link
Author

trungegd commented Dec 9, 2019

@jugglingcats I used to see this error but then I added gperf installation to make file and it worked.

init:
yum install -y gcc gcc-c++ cmake3 intltool flex bison shared-mime-info gperf

@thecfguy
Copy link

thecfguy commented Dec 19, 2019

Here is compiled one if someone do not want to go with process of building up Imagemagick.zip

Thanks @trungegd @jugglingcats @gojko

@edjames
Copy link

edjames commented Oct 21, 2020

Hi.

Sorry to open old wounds, but I'm having real problems trying to get freetype included in my build.
I've tried the following:

Unfortunately I keep getting the same error in all cases:

MiniMagick::Invalid: `/opt/bin/magick identify /tmp/mini_magick20201021-9-od9shb.pdf` failed with error:
/opt/bin/magick: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /opt/bin/magick)

Not sure if the host system makes a difference when compiling here (given it's done in a Docker container) but for what it's worth I'm on a Mac running Catalina 10.15.7

Can anyone help please?

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

6 participants