Solved

How to read metadata of JPEG using T-SQL?

Posted on 2014-01-10
3
491 Views
Last Modified: 2014-01-21
I've uploaded some JPEG images to a filestream column in SQL Server 2008. I want to extract the metadata from these into another table containing columns that represent each item of metadata. I'm not sure about the structure of metadata though. When I place my cursor over a photo icon in Explorer a caption appears containing five items (date taken, dimensions etc). Is this all there is, or are there more items of metadata embedded in the file?

Secondly, how can I read this data using T-SQL?
0
Comment
Question by:TimHudspith
3 Comments
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
ID: 39772895
Here's a link for metadata: http://www.exiv2.org/tags.html

Attached is some code I use to get some of that info.
Metadatacode.txt
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39773200
it may be a little difficult to do it in database itself...
but it will be easy to do it as a .NET library using the below approach

http://msdn.microsoft.com/en-us/library/xddt0dz7(v=vs.110).aspx

So, what I suggest is to create a library to get the metadata using .NET using the above approach and use SQLCLR to add this library and act on the input JPEG and populate your tables.

that should be an easy one rather finding the whole stuff in TSQL.
0
 

Author Comment

by:TimHudspith
ID: 39787751
ktaczala - I want to use your code inside a loop that iterates the rows of my SQL Server table containing the photos. The problem is that I can't set the SqlFileStream object. I've set this up as a separate question:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_28341070.html
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question