Support larger images
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
fa779b300e
commit
23b07de667
@ -255,7 +255,7 @@ function moveCorrupt(path, file) {
|
|||||||
if (path.indexOf(picturesPath) != 0) {
|
if (path.indexOf(picturesPath) != 0) {
|
||||||
path = picturesPath + path;
|
path = picturesPath + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn("Moving corrupt file '" + file + "' to " + path + "/corrupt");
|
console.warn("Moving corrupt file '" + file + "' to " + path + "/corrupt");
|
||||||
|
|
||||||
return mkdirPromise(path + "/corrupt").then(function() {
|
return mkdirPromise(path + "/corrupt").then(function() {
|
||||||
@ -278,6 +278,12 @@ function triggerWatcher() {
|
|||||||
if (!processRunning && processQueue.length) {
|
if (!processRunning && processQueue.length) {
|
||||||
let lastMessage = moment(), toProcess = processQueue.length, processing = processQueue.splice(0);
|
let lastMessage = moment(), toProcess = processQueue.length, processing = processQueue.splice(0);
|
||||||
processRunning = true;
|
processRunning = true;
|
||||||
|
|
||||||
|
/* Sort to newest files to be processed first */
|
||||||
|
processing.sort(function(a, b) {
|
||||||
|
return b[2] - a[2];
|
||||||
|
});
|
||||||
|
|
||||||
return Promise.map(processing, function(entry) {
|
return Promise.map(processing, function(entry) {
|
||||||
var path = entry[0], file = entry[1], created = entry[2], albumId = entry[3];
|
var path = entry[0], file = entry[1], created = entry[2], albumId = entry[3];
|
||||||
|
|
||||||
@ -304,7 +310,7 @@ function triggerWatcher() {
|
|||||||
dst = picturesPath + path + "/thumbs/" + file,
|
dst = picturesPath + path + "/thumbs/" + file,
|
||||||
image = sharp(src);
|
image = sharp(src);
|
||||||
|
|
||||||
return image.metadata().then(function(metadata) {
|
return image.limitInputPixels(1073741824).metadata().then(function(metadata) {
|
||||||
if (metadata.exif) {
|
if (metadata.exif) {
|
||||||
metadata.exif = exif(metadata.exif);
|
metadata.exif = exif(metadata.exif);
|
||||||
delete metadata.exif.thumbnail;
|
delete metadata.exif.thumbnail;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user