import sharp from 'sharp';

const MAX_DIMENSION = 200;

export async function resizeImage(buffer) {
  return sharp(buffer)
    .resize(MAX_DIMENSION, MAX_DIMENSION, { fit: 'inside', withoutEnlargement: true })
    .toBuffer();
}
