mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-08 09:02:06 +00:00
UBERF-9637 Fix: prevent sharp rotating image on resize (#8256)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
d3ffb3c2fd
commit
b531cf2cce
@ -926,6 +926,9 @@ async function getGeneratePreview (
|
||||
}
|
||||
sharp.cache(false)
|
||||
|
||||
// auto orient image based on exif to prevent resize use wrong orientation
|
||||
pipeline = pipeline.rotate()
|
||||
|
||||
pipeline = pipeline.resize({
|
||||
width: size,
|
||||
fit: 'cover',
|
||||
|
@ -105,6 +105,10 @@ export async function handleImageGet (
|
||||
await writeFile(tmpFile, blob.body)
|
||||
|
||||
let pipeline = sharp(tmpFile)
|
||||
|
||||
// auto orient image based on exif to prevent resize use wrong orientation
|
||||
pipeline = pipeline.rotate()
|
||||
|
||||
pipeline.resize({
|
||||
width,
|
||||
height,
|
||||
|
Loading…
Reference in New Issue
Block a user