0

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?

Robert
  • 19,800
  • 5
  • 55
  • 85
loicb
  • 587
  • 2
  • 6
  • 24
  • There was a similar problem with `imagick` and solution was to trim excessive data (e.g. EXIF). see [this question](http://stackoverflow.com/questions/16585584/php-page-timeout-when-aborting-readfile/16589397#16589397) – Maxim Khan-Magomedov May 23 '13 at 12:42

1 Answers1

2

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.

cleong
  • 7,242
  • 4
  • 31
  • 40