简体   繁体   中英

Php-gd png image resize bug

I have a weird bug.

When I create a thumb from a png image with transparent background, the thumb filesize is larger ( 173,56 KB 500×339 px ) than original ( 64,98 KB 600x407 px ). I think you should see this code to understand.

Is php-gd library bugged?

No, the GD library is not bugged. Your source image is a 8-bit PNG image (with a color palette). You're saving the resized image as a 32-bit true-color PNG file. That's why it's bigger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM