diff --git a/package-lock.json b/package-lock.json index 1e5e0e4..e059eb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "node-unrar-js": "^1.0.5", "opds-extra": "^3.0.9", "p7zip-threetwo": "^1.0.4", - "sharp": "^0.30.3", + "sharp": "^0.30.4", "socket.io-redis": "^6.1.1", "threetwo-ui-typings": "^1.0.14", "through2": "^4.0.2", @@ -12492,16 +12492,16 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/sharp": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.3.tgz", - "integrity": "sha512-rjpfJFK58ZOFSG8sxYSo3/JQb4ej095HjXp9X7gVu7gEn1aqSG8TCW29h/Rr31+PXrFADo1H/vKfw0uhMQWFtg==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.4.tgz", + "integrity": "sha512-3Onig53Y6lji4NIZo69s14mERXXY/GV++6CzOYx/Rd8bnTwbhFbL09WZd7Ag/CCnA0WxFID8tkY0QReyfL6v0Q==", "hasInstallScript": true, "dependencies": { - "color": "^4.2.1", + "color": "^4.2.3", "detect-libc": "^2.0.1", "node-addon-api": "^4.3.0", "prebuild-install": "^7.0.1", - "semver": "^7.3.5", + "semver": "^7.3.7", "simple-get": "^4.0.1", "tar-fs": "^2.1.1", "tunnel-agent": "^0.6.0" @@ -23640,15 +23640,15 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "sharp": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.3.tgz", - "integrity": "sha512-rjpfJFK58ZOFSG8sxYSo3/JQb4ej095HjXp9X7gVu7gEn1aqSG8TCW29h/Rr31+PXrFADo1H/vKfw0uhMQWFtg==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.30.4.tgz", + "integrity": "sha512-3Onig53Y6lji4NIZo69s14mERXXY/GV++6CzOYx/Rd8bnTwbhFbL09WZd7Ag/CCnA0WxFID8tkY0QReyfL6v0Q==", "requires": { - "color": "^4.2.1", + "color": "^4.2.3", "detect-libc": "^2.0.1", "node-addon-api": "^4.3.0", "prebuild-install": "^7.0.1", - "semver": "^7.3.5", + "semver": "^7.3.7", "simple-get": "^4.0.1", "tar-fs": "^2.1.1", "tunnel-agent": "^0.6.0" diff --git a/package.json b/package.json index c6ec5f3..efd0e78 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "node-calibre": "^2.1.1", "node-unrar-js": "^1.0.5", "p7zip-threetwo": "^1.0.4", - "sharp": "^0.30.3", + "sharp": "^0.30.4", "socket.io-redis": "^6.1.1", "threetwo-ui-typings": "^1.0.14", "through2": "^4.0.2", diff --git a/utils/uncompression.utils.ts b/utils/uncompression.utils.ts index 40c438c..56339ee 100644 --- a/utils/uncompression.utils.ts +++ b/utils/uncompression.utils.ts @@ -144,7 +144,7 @@ export const extractComicInfoXMLFromRar = async ( const coverFilePromise = new Promise((resolve, reject) => { const coverFile = path.basename(files[0].name); - const sharpStream = sharp().resize(275); + const sharpStream = sharp().resize(275).toFormat("png"); const coverExtractionStream = archive.stream(files[0].name); const resizeStream = coverExtractionStream.pipe(sharpStream); @@ -264,7 +264,7 @@ export const extractComicInfoXMLFromZip = async ( }); // Write the cover to disk const coverFilePromise = new Promise((resolve, reject) => { - const sharpStream = sharp().resize(275); + const sharpStream = sharp().resize(275).toFormat("png"); const coverStream = createReadStream( `${targetDirectory}/${path.basename(filesToWriteToDisk.coverFile)}` ); @@ -403,7 +403,7 @@ export const resizeImageDirectory = async (directoryPath: string) => { map(files, (file) => { resizePromises.push( new Promise((resolve, reject) => { - const sharpResizeInstance = sharp().resize(275); + const sharpResizeInstance = sharp().resize(275).toFormat("png"); const resizedStream = createReadStream( `${directoryPath}/${file.name}${file.extension}` );