Truncated (large) images in Gallery2 — not!

I was having a problem on with using Gallery’s image block which requires loading PHP code Frown. It would usually work just fine, but for some reason, the image was occasionally truncated. Since I have access to the backend, I could look at the raw file and knew it had uploaded just fine. Turns out I’m not the only one with this problem; you can see my own log at http://gallery.menalto.com/node/49319 along with links there to others which I found having the same problem. Bottom line is that an optimization in Apache2 which the apache documentation warns only about affecting NFS mounted files was affecting local files, too. Turned off mmap and voile, no more truncated images.