emgram769/live4chan — pull request #114 by ccd0 (2014-03-30 08:10:16+00:00)
Title: some thumbnail optimizations

Trying to make it run a little faster, as least as measured on my machine. Apparently having "%A" in the format string causes a massive slowdown as if it's reading the entire image, even for JPEGs. So I've turned off the transparency check for everything but GIFs, and am just thumbnailing all PNG files as PNGs regardless of whether they're transparent. I'm assuming their contribution to the CPU load is more of an issue at this point than their contribution to the bandwidth. We should turn the transparency check for PNGs back on if that's not the case.

Also changed the check to use "%[opaque]" instead of "%A" as it identifies fewer false-positive transparencies and they seem to take the same amount of time (I would have thought "%A" would be faster, but it wasn't). Maybe this is something that has been/will be fixed in a future version (I'm testing with 6.7.7-10). Anyway, we'll have to check if "%[opaque]" works in the installation on the server, and switch it back to using "%A" if it doesn't.