|
|
 | | From: | Guntar Klopek | | Subject: | Is this a BLOB? | | Date: | 13 Jan 2005 16:38:17 -0800 |
|
|
 | I have a limited access view on a (MLS) real estate listings ms-sql 7.0 db - and this below is supposed to be a BLOB. I used the query analyzer to query and saved the results as a .rpt and .cvs file type. In a very brief information file explaining my access and the database it says "Images are JPG's 320x208 stored as BLOB's".
What is this? Help!
My query returned this data below from the field that's supposed to contain the BLOB storage:
0xFFD8FFE000104A46494600010201009600960000FFED123A50686F746F73686F7020332E300< 03842494D03E900000000007800030000004800480000000002DA0228FFE1FFE102F902450347< 052803FC00020000004800480000000002D802280001000000640000000000030303000000012< 70F0001000100000000000000
< represents my carriage return
|
|
 | | From: | Guntar Klopek | | Subject: | Re: Is this a BLOB? | | Date: | 18 Jan 2005 06:10:35 -0800 |
|
|
 | Thanks Exponent, I also dug up this info below: Binary constants have a leading 0x (a zero and the lowercase letter x) followed by the hexadecimal representation of the bit pattern. For example, 0x2A specifies the hexadecimal value of 2A, which is equivalent to a decimal value of 42 or a one-byte bit pattern of 00101010.
This leaves me with new questions: EXP>> you could write some code to extract the binary data to a file Is the binary data hexadecimal? EXP>> then open it in some viewer I could write code to convert from hex to 0's and 1's, but then what?
What this is for: Ultimatly I need to get these BLOB's out the ms db, convert them back to jpeg's(approx. 2000-3000 images), store the jpeg's via FTP and then in my MySQL database using php I will store the location and name of the jpeg's. They will also be updated nightly by selecting image dates and comparing them to my stored image dates.
|
|
 | | From: | Exponent | | Subject: | Re: Is this a BLOB? | | Date: | 18 Jan 2005 20:20:09 +0100 |
|
|
 |
If the field really does contain a blob (raw binary data) then it can be extracted directly to a file, given a suitable file-extension if necessary (.jpg etc) then opened in a graphics app, or used as you wish in your application. No additional conversion would be required.
Hex is just a way of representing numbers, often used computing to represent binary values in a much more compact and human readable/writable fashion than binary notation. The same number or data-value can be represented in binary, octal, decimal, hex, or any other number system you choose.
It is likely that the process that you used to output the data you posted displays binary data in hex notation (showing only the first 255 bytes - the data doesn't look long enough for the image dimension you stated). It is possible, however, that the field really does contain the binary values encoded in an ASCII/text format (this is sometimes used to handle binary data in text-based systems, such as xml). In this case an additional conversion step would be required. It is also possible the data really is truncated at 255 bytes, in which case you are in trouble.
Given your description, both of the above sound unlikely, and it should be easy to extract one field directly to a binary file, then see if it's a valid jpeg image.
-- ______________________________________________________
http://www.ammara.com/ Image Handling Components, Samples, Solutions and Info DBPix 2.0 - lossless jpeg rotation, EXIF, asynchronous
"Guntar Klopek" wrote: >Thanks Exponent, I also dug up this info below: >Binary constants have a leading 0x (a zero and the lowercase letter x) >followed by the hexadecimal representation of the bit pattern. For >example, 0x2A specifies the hexadecimal value of 2A, which is >equivalent to a decimal value of 42 or a one-byte bit pattern of >00101010. > >This leaves me with new questions: >EXP>> you could write some code to extract the binary data to a file >Is the binary data hexadecimal? >EXP>> then open it in some viewer >I could write code to convert from hex to 0's and 1's, but then what? > >What this is for: Ultimatly I need to get these BLOB's out the ms db, >convert them back to jpeg's(approx. 2000-3000 images), store the jpeg's >via FTP and then in my MySQL database using php I will store the >location and name of the jpeg's. They will also be updated nightly by >selecting image dates and comparing them to my stored image dates. >
|
|
 | | From: | Igor Shekalev | | Subject: | Re: Is this a BLOB? | | Date: | Sat, 15 Jan 2005 15:09:05 +0300 |
|
|
 | Guntar,
Please try out our DTM Data Editor (www.sqledit.com/de/). It automatically detects about 25 most popular data formats and open necessary application for view binary data.
GK> I have a limited access view on a (MLS) real estate listings ms-sql GK> 7.0 db - and this below is supposed to be a BLOB. I used the query GK> analyzer to query and saved the results as a .rpt and .cvs file GK> type. In a very brief information file explaining my access and the GK> database it says "Images are JPG's 320x208 stored as BLOB's".
Igor Shekalev, http://www.sqledit.com, SQL editor with ODBC support
|
|
 | | From: | Exponent | | Subject: | Re: Is this a BLOB? | | Date: | 17 Jan 2005 09:44:22 +0100 |
|
|
 |
It certainly looks like the first 255 bytes of a jpeg image.
For further verification you could write some code to extract the binary data to a file, then open it in some viewer.
Alternatively, our Image Control binds to binary jpeg data, so you can just place one on your form, select the data source then you're ready to view the images.
-- ______________________________________________________
http://www.ammara.com/ Image Handling Components, Samples, Solutions and Info DBPix 2.0 - lossless jpeg rotation, EXIF, asynchronous
"Guntar Klopek" wrote: >I have a limited access view on a (MLS) real estate listings ms-sql 7.0 >db - and this below is supposed to be a BLOB. I used the query analyzer >to query and saved the results as a .rpt and .cvs file type. In a very >brief information file explaining my access and the database it says >"Images are JPG's 320x208 stored as BLOB's". > >What is this? Help! > >My query returned this data below from the field that's supposed to >contain the BLOB storage: > >0xFFD8FFE000104A46494600010201009600960000FFED123A50686F746F73686F7020332E300< >03842494D03E900000000007800030000004800480000000002DA0228FFE1FFE102F902450347< >052803FC00020000004800480000000002D802280001000000640000000000030303000000012< >70F0001000100000000000000 > >< represents my carriage return >
|
|
|