Martin Atkins (mart) wrote in fotobilder,
Martin Atkins
mart
fotobilder

FotoBilder on Windows crash update

You may recall that my server was crashing whenever it tried to handle a picture resize request. I've tracked down the part of the code which is making it crash, and as I suspected it's part of ImageMagick, although not the part I was expecting.

The offending line is the call to $buff->Write() in FB::gpic_append (which can be found in fotobilder.pl). I'm not familiar with what this function actually does other than the obvious "write stuff to this filehandle" so I can't diagnose any further, but hopefully this information could be useful to someone, sometime.

I'm off to update my ImageMagick install as a last-ditch attempt to get it to work. I'll update if I find a solution.


Update @ 20:31 GMT: I fixed it, but it ain't pretty. I had to change the call to the Write method described above to just include a filename rather than a filehandle and a filename. This means that, for one thing, my temp file needed to have the extension added, which was not really a big deal. However, it also means that after ImageMagick has gone to the trouble of opening a file, writing to it and closing it, my code then has to open it again, read from it, and close it once more. This is obviously not very efficient, but it seems to be the only way to get it to work since ImageMagick will, by default, write out images in the wrong format if there's no file extension or a file extension it doesn't know.

Of course, I don't expect Brad to incorporate my ugly code into FotoBilder. Instead, I'm writing a small bit of code which overwrites the gpic_append function with my version and putting that in the Apache configuration so that my test installation will use the ugly version of the code and everyone with their pretty UNIX servers can have relative efficiency. (I say relative, because that code isn't exactly pretty anyway: writing a file to disk just so it can be read in again.)

Subscribe

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic
  • 7 comments