Hey,
I am using AWS Serverless Image Handler for resizing the image along with extracting a certain cropped area. However the extraction is not working properly. I believe AWS uses Sharp Pixel for performing the image processing operations and sharp has an operation called extract
however I do not see any implementation of it in the code.
I am passing the following request
const request = {
bucket: // S3 bucket name
key, // path to your file on the S3 bucket (ex. public/larger-photo.jpg)
edits: {
webp: true, // if android, android loves webp
jpeg: true, // if iOS, iOS doesnt display webp so lets convert it
resize: { //see https://sharp.pixelplumbing.com/api-resize for docs/settings
width: 1000,
height: 750,
fit: "cover",
},
},
extract: {
left: area.x,
top: area.y,
width: area.width,
height: area.height
}
}
Out here area
is the cropped area that I need. I am not sure if I am following the right syntax as there is no documentation around it. Kindly let me know if AWS does any sort of extraction or cropping of a specific region for an image.