Open BryanGerre opened 4 years ago
I've the same problem: everything is fine, resize and other functions works fine, but the drawText just don't work and doesn't raise any error/warning.
Here's the solution: https://github.com/serverlesspub/imagemagick-aws-lambda-2/issues/6
The compiled build in https://github.com/serverlesspub/imagemagick-aws-lambda-2/issues/6 is not working for me (buffer is always empty). I've tried to build the library from 0, without changing anything from the repo, and the result is the same: buffer is always empty. I'm building with MacOs.
Any chance to get a precompiled and working layer zip with freetype?
Solved! I was finally able tu build with freetype enabled. Here's the Layer .zip to be uplaoded on AWS ;) Archivio.zip
@anija - This one worked for me, thank you very much for sharing it, you saved me a ton of work
@anija Any chance we can get a hand with this? Uploaded Archivio.zip as a new layer, linked the layer to our simple Lambda function, and now code that worked with imagemagick-aws-lambda-2 is no longer working – produces Stream yields empty buffer
output.
Here's our Lambda function with the extraneous bits removed, but this is the exact gm()
call that we're making with this new layer:
const gm = require('gm').subClass({ imageMagick: true });
...
gm(path.join(__dirname, '/file.jpg'))
.toBuffer('jpeg', (err, buffer) => {
if (err) return console.error(err); <-- this throws.
console.log(buffer)
});
Is there anything else we need to do to use / link this layer and its binaries properly?
@anija I'm not following. The .zip that you posted appears to be HarfBuzz OpenType text engine.
How does this work with imagemagick?
I've added the layer using the link ServerlessPub link and clicked deploy which added a layer named image-magick I then attached the layer to my lambda. In my lambda I have const gm = require('gm').subClass({imageMagick: true});
Is that using the layer? For some reason I'm unable to see any words on my image using drawText
here is my code in full