mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Check for crop arguments before applying it
This commit is contained in:
@@ -860,7 +860,7 @@ async function charaWrite(img_url, data, target_img, response = undefined, mes =
|
|||||||
let rawImg = await jimp.read(img_url);
|
let rawImg = await jimp.read(img_url);
|
||||||
|
|
||||||
// Apply crop if defined
|
// Apply crop if defined
|
||||||
if (typeof crop == 'object') {
|
if (typeof crop == 'object' && [crop.x, crop.y, crop.width, crop.height].every(x => typeof x === 'number')) {
|
||||||
rawImg = rawImg.crop(crop.x, crop.y, crop.width, crop.height);
|
rawImg = rawImg.crop(crop.x, crop.y, crop.width, crop.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user