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
removing animation while uploading to s3 using sharp #4022
Comments
As long as you're using both the If you still need help, please provide a standalone repo with minimal code (e.g. no networking) and image(s) that allows someone else to reproduce. |
https://github.com/jinnymoon1124/s3/blob/main/index.js |
How would someone else reproduce the problem using the code you've provided? If you still require help, please simplify the code further, for example remove all networking logic, as well as providing a sample image that can be read from the filesystem. |
@jinnymoon1124 Were you able to make any progress with this? If you still require help, please provide the requested information. |
Closing due to inactivity but please feel free to reopen with more details if further help is required. |
Question about an existing feature
I was using sharp library to resizing images, and while testing,
I found out that when type of file is gif,
after resizing, animation disappears.
What are you trying to achieve?
want to know the reason why animation disappearing..
When you searched for similar issues, what did you find that might be related?
version ? -> "sharp": "^0.32.1"
option ? -> animated: true
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
` if (contentType === "image/webp") {
await uploadFile(bucketName, filepath, originalImage, contentType);
} else {
const resizedImage = await resizeImage(originalImage, 'webp', { quality: 85 });
await uploadFile(bucketName, zippedFilePath, resizedImage, contentType);
}
...
async function resizeImage(image, format, options) {
console.log(
start resizeImage
);const resizedImage = await sharp(image, {animated: true, failOn: "truncated"})
.toFormat(format, options)
.toBuffer();
console.log(
finish resizeImage
);return resizedImage;
}
async function uploadFile(bucketName, key, data, contentType) {
console.log(
start uploadFile: ${bucketName}/${key}
);try {
await s3
.putObject({
Bucket: bucketName,
Key: key,
Body: data,
Tagging: 'writer=lambda',
ContentType: contentType
})
.promise();
} catch (error) {
console.error('Error uploading file:', error);
throw error;
}
}
`
Please provide sample image(s) that help explain this question
The text was updated successfully, but these errors were encountered: