-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Migrating from v0.16.2 to v0.27.1 #2560
Comments
Are you able to share the input image? |
@lovell - Sure. Here is link to original image |
@lovell - Thank you very much for prompt reply. I will try to provide separate repo. Only notable difference between your code and ours is, we are returning buffer where as you are saving it as file. We will try that option first and if still see the issue, will create repo. Again, thank you very much |
Were you able to make any progress with this? |
Closing due to inactivity but please feel free to reopen with more details if further help is required. |
In older version of Sharp v0.16.2, it had function called min(). This was deprecated based on documentation and replace with {fit: sharp.fit.outside} options.
Problem : When we upload same original image with newer function, we are not getting same quality and there is visible difference in image along with size.
Old Code
function resizeImage(image) {
return new Promise((resolve, reject) => {
});
}
Image resized with Old Code --> https://orion-uploads.openroadmedia.com/md_7d97a8278834-medieval-weapons.jpg
New Code
export const resizeImage = async (file) => {
return await sharp(file.buffer).resize(file.width, file.height, {fit: sharp.fit.outside}).toBuffer();
};
Image resized with New Code --> https://orion-uploads.openroadmedia.com/md_5e4601a8fc7f-medieval-weapons.jpg
We used same original image to test. We scan through entire documentation and tried various other options like karnel, sharpen etc but we aren't able to generate same image.
I will really appreciate any help on this. Thanks in advance
The text was updated successfully, but these errors were encountered: