const sourceIsPortrait = sourceImage.getWidth() < sourceImage.getHeight()
const destIsPortraitOrSquare = newSize.width <= newSize.height
const sourceIsPortrait = sourceImage.getWidth() < sourceImage.getHeight()
const destIsPortraitOrSquare = newSize.width <= newSize.height
if (sourceIsPortrait && !destIsPortraitOrSquare) {
const baseImage = sourceImage.cloneQuiet().cover(newSize.width, newSize.height)
.color([ { apply: 'shade', params: [ 50 ] } ])
if (sourceIsPortrait && !destIsPortraitOrSquare) {
const baseImage = sourceImage.cloneQuiet().cover(newSize.width, newSize.height)
.color([ { apply: 'shade', params: [ 50 ] } ])
const { sourceImage, newSize, imageBytes, inputExt, outputExt } = options
const { width, height } = newSize
const { sourceImage, newSize, imageBytes, inputExt, outputExt } = options
const { width, height } = newSize
if (sourceImage.getWidth() > width || sourceImage.getHeight() > height) return false
if (inputExt !== outputExt) return false
if (sourceImage.getWidth() > width || sourceImage.getHeight() > height) return false
if (inputExt !== outputExt) return false