🔼 Bumped sharp and changed resize format to png

This commit is contained in:
2022-05-09 12:11:41 -07:00
parent 7b2e94d9dd
commit 8f43e309d7
3 changed files with 15 additions and 15 deletions

22
package-lock.json generated
View File

@@ -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"

View File

@@ -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",

View File

@@ -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}`
);