SDK icon indicating copy to clipboard operation
SDK copied to clipboard

[image-transform] Unable to define better image quality than default

Open insekticid opened this issue 3 years ago • 0 comments

https://github.com/TryGhost/SDK/blob/ebc8a4418c349c9097aeeb35ced4e619ad888ae9/packages/image-transform/lib/transform.js#L102

you should allow to define image quality, sharp does have options.quality option, default is 80 and graphic blogs need maximum quality https://sharp.pixelplumbing.com/api-output#parameters-7

https://ghost.org/docs/themes/assets/

// package.json

"config": {
    "image_sizes": {
        "xxs": {
            "width": 30,
            "quality": 100
        },
        "xs": {
            "width": 100,
            "quality": 100
        },
        "s": {
            "width": 300,
            "quality": 100
        },
        "m": {
            "width": 600,
            "quality": 100
        },
        "l": {
            "width": 1000,
            "quality": 100
        },
        "xl": {
            "width": 2000,
            "quality": 90
        }
    }
}

it looks like, that this simple option add will enable new quality option ...imageDimensionConfig

https://github.com/TryGhost/Ghost/blob/master/ghost/core/core/frontend/web/middleware/handle-image-sizes.js#L138

insekticid avatar Aug 09 '22 10:08 insekticid