Displaying blob data from a Firebird database using PHP

前端 未结 1 994
深忆病人
深忆病人 2021-01-24 04:37

So, I have this Firebird database, with a "photo" column which I\'m trying to display.

Here is what I\'ve done so far:

  • Since the content type is

相关标签:
1条回答
  • 2021-01-24 04:46

    As a bitmap has 0x42 0x4D at position 0, and then 4 bytes of file size (0x36 0x65 0x01 0x00). In the dump you posted both bytes 5 - 8 (before the BMP header) and bytes 11-14 (filesize after BMP header) are the same, so it look like the blob has (guess work):

    • 4 bytes: some kind of application specific image type nr (?)
    • 4 bytes: file size (same as after the 0x42 0x4D)
    • Actual bitmap file

    You might want to check if skipping the first 8 bytes is enough to get it to work, then I'd check if this is generic across all files (maybe there is more than one file type!)

    0 讨论(0)
提交回复
热议问题