Solved

How to read metadata of JPEG using T-SQL?

Posted on 2014-01-10
3
469 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now