khalyomede / gulp-sharp-responsive

A gulp plugin to generate responsives images.
https://npmjs.com/package/gulp-sharp-responsive
17 stars 6 forks source link

10-portrait-images-with-exif-data-get-rotated-when-resizing #10

Closed Dartegnian closed 1 year ago

Dartegnian commented 1 year ago
const compressStories = () =>
    src("stories/**/*.{jpeg,jpg}")
        .pipe(
            sharpResponsive({
                formats: [
                    {
                        width: 1024,
                        format: "jpeg"
                    },
                ],
            })
        )
        .pipe(dest("src/assets/stories"));

I've tried several Sharp-specific options and JPEG-specific options so far and none of them work. The issue is similar to this Sharp issue.

Dartegnian commented 1 year ago

Hi, I made a pull request for this issue. It fixes this issue by calling the rotate function in Sharp before the resize function.