Remove square enforcing in resizeBase64Image (#25389)
This commit is contained in:
1 parent
d03f45dd0f
commit
ef3281f06f
1 file changed
-4
@@ -26,10 +26,6 @@ export async function resizeBase64Image(
|
||||
maxSize = 96 * 4,
|
||||
} = opts ?? {};
|
||||
const image = await jimp.read(buffer);
|
||||
if (image.getHeight() !== image.getWidth()) {
|
||||
// this could be handled later
|
||||
throw new Error("Image is not a square");
|
||||
}
|
||||
const currentSize = Math.max(image.getWidth(), image.getHeight());
|
||||
if (currentSize > maxSize) {
|
||||
image.resize(jimp.AUTO, maxSize);
|
||||
|
||||
Reference in new issue
Block a user