On Fri, Feb 22, 2008 at 6:02 PM, David Gerard <dgerard(a)gmail.com> wrote:
On 22/02/2008, Simetrical
<Simetrical+wikilist(a)gmail.com> wrote:
Well, I'm not clear on exactly what the issue
is with resizing. Is it
merely that it takes a minute per image? Or does it also take 45 GB
of RAM? If the former, we could of course just toss a couple of extra
servers at the problem. If the latter, not so easy. Domas' "No."
makes me think something closer to the latter, but I really don't
know.
It should be possible to thumbnail a PNG completely from the image
stream, using minimal memory (at the expense of speed).
I've already looked into the PNG format and libpng. Preliminaries:
The category I used as an example in my original complaint contains
greyscale PNGs, the largest ~16MB.
A little C code I wrote reads this into memory. Takes about 3 seconds,
and 22 MB (as far as I can tell from "top" in that time;-)
Shouldn't be too hard to scale it down and output it.
And yes, it could basically work per-line as well, saving memory. But
for this example, no need.
Magnus