Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency replaced with white #66

Closed
johnpturner8 opened this issue Sep 23, 2022 · 4 comments
Closed

Transparency replaced with white #66

johnpturner8 opened this issue Sep 23, 2022 · 4 comments

Comments

@johnpturner8
Copy link

When processing a PNG with transparency, the transparency is removed and replaced with a white background, even when the mimeType is set to PNG in the config.

This seems to be caused by the fix for #42, PNGs retain their transparency in the previous version.

@ericnograles
Copy link
Owner

@johnpturner8 ah good catch, let me see about plugging this bug.

@ericnograles
Copy link
Owner

ericnograles commented Sep 24, 2022

Got a fix in place, will push out a new version to NPM shortly.

Transparent PNG => mimeType: 'image/png'

image

Transparent PNG => mimeType: 'image/jpeg'

image

JPEG => mimeType: 'image/jpeg'

image

@jz222
Copy link

jz222 commented Sep 27, 2022

Hi,

I'm using 2.4.1 and still have this issue. It adds a white background to PNG's with transparent background @ericnograles.

@ericnograles
Copy link
Owner

@jz222 huh strange, pretty sure I tested it. Did you set the mimeType to image/png? By default, if nothing is specified, the library assumes image/jpeg which will give your PNG a white background by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants