serverlesspub / imagemagick-aws-lambda-2

ImageMagick for AWS Lambda 2 runtimes
https://serverless.pub
Other
259 stars 162 forks source link

Adding support for freetype to allow add text/watermarking #13

Closed thecfguy closed 4 years ago

thecfguy commented 4 years ago

Hi First of thanks for your great work and make it opensource. I am looking to add freetype support so magick command can use to add watermark or datestamp on image.

Probably below block may add this (I haven't tested it)

##freetype

FREETYPE_SOURCE=freetype-$(FREETYPE_VERSION).tar.gz

$(FREETYPE_SOURCE):
    curl -L http://www.imagemagick.org/download/delegates//$(FREETYPE_SOURCE) -o $(FREETYPE_SOURCE)
    tar xf $<
    cd freetype-*
    $(CONFIGURE)
    make clean
    make install
gojko commented 4 years ago

adding freetype is a bit more complicated because of its dependencies. check out how to build freetype in this project https://github.com/serverlesspub/rsvg-convert-aws-lambda-binary - you'll need to include the dependencies from that buildfile, and the fonts you want to use, into the layer

jfederer commented 2 years ago

"you'll need to include the dependencies from that buildfile, and the fonts you want to use, into the layer"

Any chance of expanding on this?

Add what dependencies? What buildfile? (ie: do we need to go through the manual build process for this layer, or are you refering to steps after the existing layer has been deployed?) How do we add them? Into what layer?

Is there any example of this anywhere? (or any other example where a lambda is used to put a text based watermark on an image? All the online tutorials that explain how to do it refer to the imagemagick-aws-lambda-2 layer, which, as the author, you know doesn't have that capability.