存储为图像数据类型的图像类型

时间:2014-06-20 16:43:49

标签: sql-server image

有一个应用程序在数据库中存储一些图标,数据类型为图像。我很难确定存储什么类型的文件,以便我可以将其导出为实际的图像/图标。

问题1:有没有办法找出图像数据类型下存储在sql server中的图像类型?

问题2:他们从文本文件中填充此表。这里有什么内容(对不起,如果这是垃圾邮件,但也许有些人可以识别)。我试图找出它的图像类型:

28000000100000000f0000000100080000000000f00000001217000012170000000100000000000000000000000080000080000000808000800000008000800080800000c0c0c000c0dcc000f0caa600eeeeee00dddddd00cccccc00bbbbbb00aaaaaa00999999008888880077777700666666005555550044444400333333002222220011111100ccffff0099ffff0066ffff0033ffff00ffccff00ccccff0099ccff0066ccff0033ccff0000ccff00ff99ff00cc99ff009999ff006699ff003399ff000099ff00ff66ff00cc66ff009966ff006666ff003366ff000066ff00ff33ff00cc33ff009933ff006633ff003333ff000033ff00cc00ff009900ff006600ff003300ff00ffffcc00ccffcc0099ffcc0066ffcc0033ffcc0000ffcc00ffcccc0099cccc0066cccc0033cccc0000cccc00ff99cc00cc99cc009999cc006699cc003399cc000099cc00ff66cc00cc66cc009966cc006666cc003366cc000066cc00ff33cc00cc33cc009933cc006633cc003333cc000033cc00ff00cc00cc00cc009900cc006600cc003300cc00ffff9900ccff990099ff990066ff990033ff990000ff9900ffcc9900cccc990099cc990066cc990033cc990000cc9900ff999900cc999900669999003399990000999900ff669900cc66990099669900666699003366990000669900ff339900cc33990099339900663399003333990000339900ff009900cc009900990099006600990033009900ffff6600ccff660099ff660066ff660033ff660000ff6600ffcc6600cccc660099cc660066cc660033cc660000cc6600ff996600cc99660099996600669966003399660000996600ff666600cc666600996666003366660000666600ff336600cc33660099336600663366003333660000336600ff006600cc006600990066006600660033006600ffff3300ccff330099ff330066ff330033ff330000ff3300ffcc3300cccc330099cc330066cc330033cc330000cc3300ff993300cc99330099993300669933003399330000993300ff663300cc66330099663300666633003366330000663300ff333300cc333300993333006633330000333300ff003300cc003300990033006600330033003300ccff000099ff000066ff000033ff0000ffcc0000cccc000099cc000066cc000033cc0000ff990000cc99000099990000669900000000ee000000dd000000cc000000bb000000aa0000009900000088000000770000006600000055000000440000003300000022000000110000ee000000dd000000cc000000bb000000aa0000009900000088000000770000006600000055000000440000003300000022000000110000ee000000dd000000cc000000bb000000aa0000009900000088000000770000006600000055000000440000003300000022000000f0fbff00a4a0a000808080000000ff0000ff000000ffff00ff000000ff00ff00ffff0000ffffff0007ffffffffffffffffffffffffffff07ffff000000000000000000000000ffffff0002020202020202020202020200ffff0002020202020202020202020200ffff0002020200020202020002020200ffff0002020002020000020200020200ffff000200020200f9f9000202000200ffff0002000200f9f9f9f90002000200ffff0002000200f9f9f9f90002000200ffff000200020200f9f9000202000200ffff0002020002020000020200020200ffff0002020200020202020002020200ffff0002020202020202020202020200ffffff000000000000000000000000ffff07ffffffffffffffffffffffffffff07

响应"数据库中存储的内容,请" 在sql server中,使用数据类型image,这是存储的值(与上面相同,但前面有0x):

0x28000000100000000F0000000100080000000000F00000001217000012170000000100000000000000000000000080000080000000808000800000008000800080800000C0C0C000C0DCC000F0CAA600EEEEEE00DDDDDD00CCCCCC00BBBBBB00AAAAAA00999999008888880077777700666666005555550044444400333333002222220011111100CCFFFF0099FFFF0066FFFF0033FFFF00FFCCFF00CCCCFF0099CCFF0066CCFF0033CCFF0000CCFF00FF99FF00CC99FF009999FF006699FF003399FF000099FF00FF66FF00CC66FF009966FF006666FF003366FF000066FF00FF33FF00CC33FF009933FF006633FF003333FF000033FF00CC00FF009900FF006600FF003300FF00FFFFCC00CCFFCC0099FFCC0066FFCC0033FFCC0000FFCC00FFCCCC0099CCCC0066CCCC0033CCCC0000CCCC00FF99CC00CC99CC009999CC006699CC003399CC000099CC00FF66CC00CC66CC009966CC006666CC003366CC000066CC00FF33CC00CC33CC009933CC006633CC003333CC000033CC00FF00CC00CC00CC009900CC006600CC003300CC00FFFF9900CCFF990099FF990066FF990033FF990000FF9900FFCC9900CCCC990099CC990066CC990033CC990000CC9900FF999900CC999900669999003399990000999900FF669900CC66990099669900666699003366990000669900FF339900CC33990099339900663399003333990000339900FF009900CC009900990099006600990033009900FFFF6600CCFF660099FF660066FF660033FF660000FF6600FFCC6600CCCC660099CC660066CC660033CC660000CC6600FF996600CC99660099996600669966003399660000996600FF666600CC666600996666003366660000666600FF336600CC33660099336600663366003333660000336600FF006600CC006600990066006600660033006600FFFF3300CCFF330099FF330066FF330033FF330000FF3300FFCC3300CCCC330099CC330066CC330033CC330000CC3300FF993300CC99330099993300669933003399330000993300FF663300CC66330099663300666633003366330000663300FF333300CC333300993333006633330000333300FF003300CC003300990033006600330033003300CCFF000099FF000066FF000033FF0000FFCC0000CCCC000099CC000066CC000033CC0000FF990000CC99000099990000669900000000EE000000DD000000CC000000BB000000AA0000009900000088000000770000006600000055000000440000003300000022000000110000EE000000DD000000CC000000BB000000AA0000009900000088000000770000006600000055000000440000003300000022000000110000EE000000DD000000CC000000BB000000AA0000009900000088000000770000006600000055000000440000003300000022000000F0FBFF00A4A0A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF0007FFFFFFFFFFFFFFFFFFFFFFFFFFFF07FFFF000000000000000000000000FFFFFF0002020202020202020202020200FFFF0002020202020202020202020200FFFF0002020200020202020002020200FFFF0002020002020000020200020200FFFF000200020200F9F9000202000200FFFF0002000200F9F9F9F90002000200FFFF0002000200F9F9F9F90002000200FFFF000200020200F9F9000202000200FFFF0002020002020000020200020200FFFF0002020200020202020002020200FFFF0002020202020202020202020200FFFFFF000000000000000000000000FFFF07FFFFFFFFFFFFFFFFFFFFFFFFFFFF07

1 个答案:

答案 0 :(得分:2)

这似乎是一个类似的帖子:PHP : binary image data, checking the image type

至于你可以从SQL端做什么都没有,提取数据的应用程序需要弄明白。这就是BOL对它的评价:http://technet.microsoft.com/en-us/library/ms189574(v=sql.105).aspx

Data in an image data is stored as a string of bits and is not interpreted by SQL Server. 
Any interpretation of the data in an image column must be made by the application. For 
example, an application could store data in an image column using a BMP, TIFF, GIF, or 
JPEG format. The application that reads the data from the image column must recognize the 
format of the data and display it correctly. All an image column does is provide a 
location to store the stream of bits that make up the image data value.