Changes to file names
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8ddbcc24a7
commit
347ac77878
|
@ -54,7 +54,7 @@ module.exports = Self => {
|
|||
};
|
||||
|
||||
await fs.mkdir(dstDir, {recursive: true});
|
||||
await sharp(srcFilePath, {failOnError: false})
|
||||
await sharp(srcFilePath)
|
||||
.resize(collection.maxWidth, collection.maxHeight, resizeOpts)
|
||||
.png()
|
||||
.toFile(dstFile);
|
||||
|
@ -69,7 +69,7 @@ module.exports = Self => {
|
|||
};
|
||||
|
||||
await fs.mkdir(dstDir, {recursive: true});
|
||||
await sharp(srcFilePath, {failOnError: false})
|
||||
await sharp(srcFilePath)
|
||||
.resize(size.width, size.height, resizeOpts)
|
||||
.png()
|
||||
.toFile(dstFile);
|
||||
|
|
|
@ -47,12 +47,7 @@ module.exports = Self => {
|
|||
if (!image) return;
|
||||
|
||||
const srcFile = image.url.split('/').pop();
|
||||
const dotIndex = srcFile.lastIndexOf('.');
|
||||
|
||||
let fileName = srcFile.substring(0, dotIndex);
|
||||
if (dotIndex == -1)
|
||||
fileName = srcFile;
|
||||
|
||||
const fileName = srcFile.replace(/\./g, '');
|
||||
const file = `${fileName}.png`;
|
||||
const filePath = path.join(tempPath, file);
|
||||
|
||||
|
|
Loading…
Reference in New Issue