onurzorluer / react-image-file-resizer

Resize Local Images with React 🌄 🌅
MIT License
313 stars 41 forks source link

PNG transparency is lost even when using compressFormat PNG #56

Closed peterzanetti closed 3 years ago

peterzanetti commented 3 years ago

I'm pretty baffled that this is the case, but indeed it seems to be.

My function looks like

resizeFaviconLogo = (file) => new Promise((resolve) => { Resizer.imageFileResizer( file, 256, 256, 'PNG', 100, 0, (uri) => { resolve(uri); }, 'file' ); });

And the output PNG has a white background instead of transparency.

peterzanetti commented 3 years ago

Please tell me this is not intended behavior and I didn't waste an entire day integrating this library only to find that it destroys every PNG it touches.

onurzorluer commented 3 years ago

fixed in v0.4.7

peterzanetti commented 3 years ago

You're a hero. Thank you very much.