[Image-SIG] Place image into MySQL db.

Fredrik Lundh fredrik at pythonware.com
Sun Dec 18 17:09:26 CET 2005


"S. D. Rose" wrote:

> I think I should have been a little more specific.  I have a process that
> takes a bunch of photos and stores them 'as taken' in .JPG format. /.../
> I guess I could img.save(file, 'jpg') and then read the file and then insert
> it, but that seems to be a particularly in-elegant way to do it.

you don't have to be more specific, you just have to read the
replies you get:

    to save to a string, use a StringIO or cStringIO stream as the target:

        out = cStringIO.StringIO()
        im.save(out, "jpeg")
        data = out.getvalue()

</F>





More information about the Image-SIG mailing list