meh
This commit is contained in:
parent
342825653e
commit
c6798f7a08
|
@ -115,6 +115,7 @@ self.generateThumbs = () => {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
exec('convert '+thumbnail+' -resize "128x128^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
exec('convert '+thumbnail+' -resize "128x128^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
||||||
|
if(error) console.log(error);
|
||||||
self.log((error?'failed':'generated') + ' thumbnail for '+e.id+' ('+e.mime+')');
|
self.log((error?'failed':'generated') + ' thumbnail for '+e.id+' ('+e.mime+')');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -122,6 +123,7 @@ self.generateThumbs = () => {
|
||||||
case "image/png":
|
case "image/png":
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
exec('convert '+e.dest+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
exec('convert '+e.dest+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
||||||
|
if(error) console.log(error);
|
||||||
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
@ -133,6 +135,7 @@ self.generateThumbs = () => {
|
||||||
dat.on('finish', () => {
|
dat.on('finish', () => {
|
||||||
dat.close();
|
dat.close();
|
||||||
exec('convert '+thumbnail+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
exec('convert '+thumbnail+' -resize "200x200^" -gravity center -crop 128x128+0+0 +repage '+thumbnail, (error) => {
|
||||||
|
if(error) console.log(error);
|
||||||
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
self.log((error)?'failed thumbnail for '+e.id+' ('+e.mime+')':'generated thumbnail for '+e.id+' ('+e.mime+')');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -213,7 +213,7 @@ function Websrv(tlib) {
|
||||||
res.write(file, "binary");
|
res.write(file, "binary");
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fs.readFile(filePath, (error, content) => {
|
fs.readFile(filePath, (error, content) => {
|
||||||
|
@ -230,7 +230,7 @@ function Websrv(tlib) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length, 'Cache-Control': 'max-age=2592000, public' });
|
//res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length, 'Cache-Control': 'max-age=2592000, public' });
|
||||||
res.writeHead(200);
|
res.writeHead(200);
|
||||||
res.end(content, 'utf-8');
|
res.end(content, 'utf-8');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user