Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Sql Server stored scanned images

Author  Topic 

sebastian
Starting Member

3 Posts

Posted - 2005-07-25 : 11:46:20
I have scanned images stored in SQL Server 2000. I am running a series of queries against the database via Ms Access 2K.

1- File sizes of scanned images. I have managed to determine this by using the FIleLen() method against the address of the image. Works perfectly ;)

2 - I need help to determine the page size of the scanned image. Im sure this data is contained within the file, I just need a method that can extract it via MS Access or SQL Server???

Can anyone help???

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2005-07-25 : 19:17:45
First of all, it's generally not regarded as good practice to store images in your database. If you must, then I would store the image size (I assume this is what you mean by page size) in a separate field when you're saving the image. If that's not an option, all you can do is dump the contents to a file and then use some image manipulation library to get the file size (.NET has this inbuilt).
There is an alternative, but it means having intimate knowledge of the jpg/tiff file formats. It means extracting the image size from the file metatags. I'd avoid this one unless a)you're after a challenge b)performance is an issue c)you're a masochist/support the English cricket team :-).

HTH,

Tim
Go to Top of Page

sebastian
Starting Member

3 Posts

Posted - 2005-07-26 : 05:01:35
Thanks for your Reply Timmy.

When I say "page size" I mean the actual size of the paper that the image has been scaned onto. I can find the "file size" with the FileLen() method........
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-07-26 : 09:43:42
Can you easily determine the height x width [presumably available in the data stream of the image file], in pixels, and the resolution that the image was scanned at? I imgine you could calcaulte the page size from that.

Kristen
Go to Top of Page

sebastian
Starting Member

3 Posts

Posted - 2005-07-26 : 10:10:23
message for Kriten:

thanks for the reply.

I can individually query each .tiff file by working out - pixels/resolution = paper size, but I need to do this to batch of documents simultaneously. Preferably via Sql Server or MS Access. Is their any Sql Server bolt on tools that I could use to query .tiff file attributes???
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-07-27 : 07:19:33
"query .tiff file attributes"

I don't know the structure of a TIFF, but I imagine the data you need is in a structured "header section", so you could just read the first N bytes and then extract the relevant information. If the header information is in a fixed-length format it will be easy, variable length will be a little harder

Kristen
Go to Top of Page
   

- Advertisement -