|
@ -142,7 +142,14 @@ class ImageService extends SiteService { |
|
|
image.metadata = outputMetadata; |
|
|
image.metadata = outputMetadata; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
let chain = sharpImage.clone().resize({ width: output.width, height: output.height }); |
|
|
let chain = sharpImage |
|
|
|
|
|
.clone() |
|
|
|
|
|
.resize({ |
|
|
|
|
|
width: output.width, |
|
|
|
|
|
height: output.height, |
|
|
|
|
|
options: output.resizeOptions, |
|
|
|
|
|
}) |
|
|
|
|
|
; |
|
|
chain = chain[output.format](output.formatParameters); |
|
|
chain = chain[output.format](output.formatParameters); |
|
|
|
|
|
|
|
|
output.filePath = path.join(imageWorkPath, `${image._id}.${output.width}x${output.height}.${output.format}`); |
|
|
output.filePath = path.join(imageWorkPath, `${image._id}.${output.width}x${output.height}.${output.format}`); |
|
|