[python-win32] How to convert an OLE image from ODBC?

Steven James steven.james at gmail.com
Fri May 11 14:51:42 CEST 2007


It appears that your database is adding a header of its own on the image
file (or maybe this is part of it being an OLE object, not sure).

If you strip off the first 88 bytes, this is a standard windows bitmap file.
The following code works on your file, but for your code you should just
start dumping the data at the 89th byte.

dump_file = file('show.dump', 'rb')
out_file = file('show.bmp', 'wb')

dump_file.seek(88)
out_file.write(dump_file.read())

dump_file.close()
out_file.close()

Steven James

On 5/11/07, Grzegorz Adam Hankiewicz <ghankiewicz at rastertech.es> wrote:
>
> Steven James wrote:
> > Can you post one of those tempfiles somewhere?
>
> Yes, you can grab them from http://gradha.no-ip.org/temp/, a .bmp and
> .dump version. From the sizes and the stringisation of the files looks
> like the .dump version is just the same with a header, but I wouldn't
> like to try stripping these bytes in case the header can change size.
>
> --
> Rastertech España S.A.
>         Grzegorz Adam Hankiewicz
> /Jefe de Producto TeraVial/
>
> C/ Perfumería 21. Nave I. Polígono industrial La Mina
> 28770 Colmenar Viejo. Madrid (España)
> Tel. +34 918 467 390 (Ext.17)     *·*           Fax +34 918 457 889
> ghankiewicz at rastertech.es         *·*           www.rastertech.es
> <http://www.rastertech.es/>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070511/9256e95d/attachment.htm 


More information about the Python-win32 mailing list