?
Solved

How to read metadata of JPEG using T-SQL?

Posted on 2014-01-10
3
Medium Priority
?
535 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
ktaczala earned 2000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

764 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