mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
parent
fab623bb52
commit
6fd42e3b62
4 changed files with 34 additions and 12 deletions
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
fs.mkdirSync(rootPath);
|
||||
await moveFile(inputs.file.fd, filePath);
|
||||
|
||||
const image = sharp(filePath, {
|
||||
let image = sharp(filePath, {
|
||||
animated: true,
|
||||
});
|
||||
|
||||
|
@ -46,7 +46,11 @@ module.exports = {
|
|||
const thumbnailsPath = path.join(rootPath, 'thumbnails');
|
||||
fs.mkdirSync(thumbnailsPath);
|
||||
|
||||
const { width, pageHeight: height = metadata.height } = metadata;
|
||||
let { width, pageHeight: height = metadata.height } = metadata;
|
||||
if (metadata.orientation && metadata.orientation > 4) {
|
||||
[image, width, height] = [image.rotate(), height, width];
|
||||
}
|
||||
|
||||
const isPortrait = height > width;
|
||||
const thumbnailsExtension = metadata.format === 'jpeg' ? 'jpg' : metadata.format;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const image = sharp(inputs.file.fd, {
|
||||
let image = sharp(inputs.file.fd, {
|
||||
animated: true,
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,11 @@ module.exports = {
|
|||
|
||||
fs.mkdirSync(rootPath);
|
||||
|
||||
const { width, pageHeight: height = metadata.height } = metadata;
|
||||
let { width, pageHeight: height = metadata.height } = metadata;
|
||||
if (metadata.orientation && metadata.orientation > 4) {
|
||||
[image, width, height] = [image.rotate(), height, width];
|
||||
}
|
||||
|
||||
const extension = metadata.format === 'jpeg' ? 'jpg' : metadata.format;
|
||||
|
||||
try {
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const image = sharp(inputs.file.fd, {
|
||||
let image = sharp(inputs.file.fd, {
|
||||
animated: true,
|
||||
});
|
||||
|
||||
|
@ -37,7 +37,11 @@ module.exports = {
|
|||
|
||||
fs.mkdirSync(rootPath);
|
||||
|
||||
const { width, pageHeight: height = metadata.height } = metadata;
|
||||
let { width, pageHeight: height = metadata.height } = metadata;
|
||||
if (metadata.orientation && metadata.orientation > 4) {
|
||||
[image, width, height] = [image.rotate(), height, width];
|
||||
}
|
||||
|
||||
const extension = metadata.format === 'jpeg' ? 'jpg' : metadata.format;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue