Closed prince-thind closed 1 year ago
hey man, i know it's a bit too late but now you can finally use the preserveMetadata
option to preserve the orientation in vite-plugin-vsharp@1.5.4.
import {defineConfig} from 'vite'
import vsharp from 'vite-plugin-vsharp'
export default defineConfig({
plugins: [
vsharp({
preserveMetadata: {
orientation: true
}
})
]
})
In the default settings there is no way to specify the preservation of image meta data. Here's a stack overflow discussion highlighting the procedure to implement that in sharpjs. It's just annoying when the compressed images just randomly rotate and hence make this package unfit for many scenarios involving JPG images.