export async function ProcessImages()

in src/handlers/provider-ace.ts [48:76]


export async function ProcessImages(event: any): Promise<ProcessingStepResult>  {
    const imageObj = await S3.getObject({
        Bucket: event.bucketName,
        Key: event.objectKey
    }).promise();

    const buff: Buffer = imageObj.Body as Buffer;
    const image = await Jimp.read(buff);
    const awsLogo = await Jimp.read("http://awsmedia.s3.amazonaws.com/AWS_Logo_PoweredBy_127px.png");

    const padding = 10;
    image.greyscale();
    image.composite(awsLogo, padding, image.bitmap.height - awsLogo.bitmap.height - padding);

    const imageBuffer = await image.getBufferAsync(Jimp.MIME_JPEG);

    await S3.putObject({
        Body: imageBuffer,
        Bucket: OUTPUT_BUCKET_NAME,
        Key: event.objectKey
    }).promise();

    return {
        AssetId: event.assetId,
        Bucket: OUTPUT_BUCKET_NAME,
        Key: event.objectKey,
        Type: "Image"
    };
}