pull/134/head
Vladimir Mandic 2021-04-19 11:20:24 -04:00
parent db40c5b727
commit f1a1361e17
1 changed files with 1 additions and 2 deletions

View File

@ -54,9 +54,8 @@ async function detect(input) {
log.info('Loading image:', input);
if (input.startsWith('http')) {
const res = await fetch(input);
const mime = res.headers.get('content-type');
if (res && res.ok) buffer = await res.buffer();
else log.error('Invalid image URL:', input, res.status, res.statusText, mime);
else log.error('Invalid image URL:', input, res.status, res.statusText, res.headers.get('content-type'));
} else {
buffer = fs.readFileSync(input);
}