0

Can someone help me?

I need to be able to read a BLOB in c# of an image from Oracle, created in Access.

This image is stored in an Access form using Ctrl+V, so I think the file type is OLE.

I have tried several ways to read this image, using Paint, GIMP, and even Word (I tried adding the object to the text), but so far I have not been successful.

In C#, I have tried opening Image.FromStream, but I always receive the error System.ArgumentException: 'Parameter is not valid.'

Note: I downloaded the binary through Oracle SQL Developer by clicking on the blob and then on Download. I don't know if it's the best way, it's my first time working with Oracle.

I also tried the code of this topic but didn't worked Convert Access image OLE Object into raw image byte array in C#

Does anyone have any tips on how to read this type of image?

Thank you very much!

  • I have a vague sense I've run into (and repressed) an actual bug with the Oracle OLE driver related to blob fields at some point in the past. – Joel Coehoorn May 01 '23 at 18:12
  • I faced something like this with Northwind DB. Fortunately, there were SQL scripts available, so I just stripped ole headers manually (as long as there were less that 20 fotos). You may save some blobs "as is" and examine them – Old Skull May 01 '23 at 19:12
  • 1
    There are dozens of types of OLE objects that can hold images and to which you can paste. Without knowing which one it is, we can't say how to extract the image data from it. – Erik A May 01 '23 at 19:35
  • @ErikA do you know if there are any way for me to know what type of OLE object Access is writing by default? – Pedro Afonso May 01 '23 at 20:15
  • There's no such thing as a default here. If you have the Access application, you can see how the forms are configured, but that's no guarantee all data is uploaded using the forms – Erik A May 01 '23 at 22:15
  • Yes, I don't think I can read these files. I already tried to use MimeDetective, but I always receive 'application/octet-stream'. From what I understand, in this project, all of the images were saved in Live Forms via Ctrl+V. So, I don't think there is an easy way to retrieve these images. – Pedro Afonso May 02 '23 at 10:36
  • @PedroAfonso, save the blob as is, then try to find the signature of the image format manually, e.g. with hex viewer/editor. Some of them: [BMP](https://www.file-recovery.com/bmp-signature-format.htm), [JPG](https://www.file-recovery.com/jpg-signature-format.htm), [PNG](http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature). If all the images were created in the same way, they will probably have the same format, therefore the starting blocks of the blobs that can be stripped will probably have the same size. Or at least they could be calculated. – Old Skull May 02 '23 at 14:39
  • Further to comment from @OldSkull , [this answer](https://stackoverflow.com/a/19709053/2144390) might be helpful. – Gord Thompson May 02 '23 at 15:08
  • Thanks for your help, I solved with this VB code [this code](https://www.tek-tips.com/viewthread.cfm?qid=83457) It's not the best approach, but it's what I managed to do. – Pedro Afonso May 03 '23 at 11:10

0 Answers0