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

2007-05-11 Thread Grzegorz Adam Hankiewicz
I have an access database I can access through python. A query for the image column returns binary data, but this data is in OLE image/bitmap format. Is it possible to convert this into something PIL understands? -- Rastertech EspaƱa S.A. Grzegorz Adam Hankiewicz /Jefe de Producto

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

2007-05-11 Thread Steven James
Have you tried writing the binary data to a file, then reading it from that file with PIL? Also, you could try Image.frombuffer() if you can coerce the binary data into a python string. I just finished a win32 project that read thumbnails from COM using IExtractImage and the data came in with

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

2007-05-11 Thread Steven James
Can you post one of those tempfiles somewhere? On 5/11/07, Grzegorz Adam Hankiewicz [EMAIL PROTECTED] wrote: Steven James wrote: Have you tried writing the binary data to a file, then reading it from that file with PIL? Also, you could try Image.frombuffer() if you can coerce the binary

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

2007-05-11 Thread Tim Golden
Grzegorz Adam Hankiewicz wrote: Steven James wrote: Have you tried writing the binary data to a file, then reading it from that file with PIL? Also, you could try Image.frombuffer() if you can coerce the binary data into a python string. I just finished a win32 project that read

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

2007-05-11 Thread Steven James
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

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

2007-05-11 Thread Tim Golden
Steven James wrote: 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

Re: [python-win32] translating VB into Python...

2007-05-11 Thread Tim Roberts
Michael March wrote: Cool.. The docs have this: Public Property Field( _ ByVal FieldName As String _ ) As Variant Can we infer the default property from this? No, all this tells you is that you feed a string as a parameter. You have to know more about the Variant that will be

Re: [python-win32] win32com.client.DispatchWithEvents free threading reentrancy

2007-05-11 Thread Richard Bell
Thanks for the response. The symptom I was seeing suggested that while a thread was processing one event, it was being re-entered. Some additional Investigation revealed that the apparent problem was caused by the event handler terminating before it was finished when it tried to reference the

[python-win32] Referencing IE's DOM when using free thread win32com.client.DispatchWithEvents

2007-05-11 Thread Richard Bell
My adventures in IE automation continue. I'm now able to start IE, navigate to a page, and process events as they occur. Unfortunately, when I try to reference the document after it is loaded and displayed I encounter a number of problems. The relevant code is as follows: self.ie =