-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Sharp 0.12.1 is incorrectly resizing the following PNG image when embed() function is used and the output image has different aspect ratio than the original image.
It seems that only rgb16 png images are affected by this issue.
I'm using vips 8.1.1 with libpng 1.5.13.
the original image
Metadata: format=png, width=600, height=600, space=rgb16, channels=4, hasProfile=false, hasAlpha=true
##### the result of img.embed().resize(200, 201) ##### the result of img.embed().resize(200, 200) ##### the result of img.resize(200, 201) ##### Steps to reproduce: 1. Download the source imagecurl -O http://i.imgur.com/9Y6MLBf.png-
Execute the following Node.js script
var sharp = require('sharp'); var img = sharp('9Y6MLBf.png'); img.embed().resize(200,201).toFile('resized-200x201-embed.png'); img = sharp('9Y6MLBf.png'); img.resize(200,201).toFile('resized-200x201-noembed.png'); img = sharp('9Y6MLBf.png'); img.embed().resize(200,200).toFile('resized-200x200-embed.png');



