diff --git a/lib/image/imagemagick.js b/lib/image/imagemagick.js index 91a5534..a99bf0f 100644 --- a/lib/image/imagemagick.js +++ b/lib/image/imagemagick.js @@ -242,7 +242,16 @@ module.exports = { args.push('-clone'); args.push('0--1'); args.push('-resize'); - args.push(size.width + 'x' + size.height + '>'); + if (size.mode && size.mode == 'cropCenter') { + args.push(size.width + 'x' + size.height + '^'); + args.push('-gravity'); + args.push('Center'); + args.push('-crop'); + args.push(size.width + 'x' + size.height +'+0+0'); + args.push('+repage'); + } else { + args.push(size.width + 'x' + size.height + '>'); + } if (context.scaledJpegQuality && (context.extension === 'jpg')) { args.push('-quality'); args.push(context.scaledJpegQuality);