|
|
@@ -5,8 +5,10 @@ const imLib = require('imagemagick');
|
|
|
const ThreadPool = require('../threadPool.js');
|
|
|
const MetaStruct = require('./metaStruct.js').MetaStruct;
|
|
|
|
|
|
+const IMAGEMAGICK_THREAD_COUNT = 3;
|
|
|
+
|
|
|
class ImagemagickWrapper {
|
|
|
- #threadPool = new ThreadPool(5);
|
|
|
+ #threadPool = new ThreadPool(IMAGEMAGICK_THREAD_COUNT);
|
|
|
|
|
|
readMeta(path) {
|
|
|
return this.#threadPool.pushTask(() => new Promise((ok, ko) => {
|
|
|
@@ -115,7 +117,7 @@ module.exports.parse = async (fileObj, data) => {
|
|
|
result.tags = readTags(imdata);
|
|
|
}
|
|
|
catch (err) {
|
|
|
- result.imException = err.toString();
|
|
|
+ return {};
|
|
|
}
|
|
|
for (let i of Object.keys(result))
|
|
|
if (result[i] === undefined || result[i].length === 0)
|