You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the algorithm seems to be finding the center of the image, drawing a square from there, and cropping it. This doesn't maximize the amount of detail, and is unexpected.
The automatic behaviour should resize the entire image first along the smaller dimension (width/height), making sure to maintain aspect ratio. Then to the center+crop magic.
[11:32:02 PM] Trevor: image.resizeImage = function(path, extension, width, height, callback) {
function done(err, stdout, stderr) {
callback(err);
}
if(extension === '.gif') {
gm().in(path)
.in('-coalesce')
.in('-resize')
.in(width+'x'+height)
.write(path, done);
} else {
gm(path)
.gravity('Center')
.crop(width, height)
.write(path, done);
}
};
[11:32:25 PM] Trevor: i feel like something is missing
... snip ✂ snip ...
[11:32:56 PM] Julian Lam: well
[11:32:58 PM] Julian Lam: it's not resizing
[11:33:00 PM] Julian Lam: it's cropping
[11:33:11 PM] Julian Lam: so what should happen instead
[11:33:56 PM] Julian Lam: is it should resize down to the max pixel count along the shortest dimension (e.g. 128x128 and picture is vertical? resize to 128px width)
[11:33:59 PM] Julian Lam: then center and crop.
[11:34:13 PM] Trevor: yes
The text was updated successfully, but these errors were encountered:
Right now, the algorithm seems to be finding the center of the image, drawing a square from there, and cropping it. This doesn't maximize the amount of detail, and is unexpected.
The automatic behaviour should resize the entire image first along the smaller dimension (width/height), making sure to maintain aspect ratio. Then to the center+crop magic.
The text was updated successfully, but these errors were encountered: