Skip to content

Sharp png compression is not working inside webiny package #2318

Open
@sunnythelucky

Description

@sunnythelucky

Version

5.25.0

Operating System

OS

Browser

Chrome

What steps will reproduce the bug?

We modified compressionLevel in optimizeImage.ts and transformImage.ts from ./node_modules/@webiny/api-file-manager/handlers/transform and then use patch command to update @webiny package in node_module. But the png image is not being compressed as we expected. So we tested it with a separate script using exact same version of sharp and see if the compression makes any issue that turned out to be not happening. What we want to do is to compress Image after resizing.

What is the expected behavior?

compress png => resize => compress png

What do you see instead?

.png({compressionLevel: 9}) is not working properly instead when we run .toFormat("jpeg",{ quality : 50}) on png, it works just fine

Additional information

No response

Possible solution

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions