Friday, June 26, 2009

Reading Image Metadata Tags with Dot Net

Hi All,

I had to find a way to tag images and then use the tagged images to be searched with the help of tagged keywords. Example, if some images are tagged with the keywords "xxx", then searching for xxx should produce the image with xxx tag in the search results.

I tried with various document management software and all of these are actually very handy tools but they don't add metadata tags to images. Since we are spread all over the word, I thought it will be very often that the images will flow from one corner to other and the tags should flow along with the images. So the document management software approach ended with no benefit. Then I thought to develop a sample on my own.

There was one more reason for developing it. I wanted to search the images and provide a custom task ( eg, Inserting the image in powerpoint) which no software gives.

I download a free tagging software called ITag (Click here for Download). And tag all of images with various keywords using this software. It is really a good tool to add metadata tags.

Now when I added the tags, the following xml was added in the image (you can easily read the tags by editing the image files.)

< rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmpMM:InstanceID="uuid:02ab02d9-02d1-11da-9510-ec7226ba1889" xmpMM:DocumentID="adobe:docid:photoshop:02ab02d2-02d1-11da-9510-ec7226ba1889" tiff:ResolutionUnit="2" tiff:YResolution="72/1" tiff:XResolution="72/1" tiff:Orientation="1" tiff:NativeDigest="256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;F68680A2E9A53199A34ACB3FE0102FCA" xmp:ModifyDate="2005-08-01T17:16:48+05:30" xmp:CreatorTool="Adobe Photoshop 7.0" exif:PixelYDimension="227" exif:PixelXDimension="892" exif:ColorSpace="65535" exif:NativeDigest="36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;1064FAD10D9AAF6E380C481B30061C1D">

< dc:subject>< rdf:Bag xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">< rdf:li>Banking< /rdf:li>< rdf:li>Blinx< /rdf:li>< rdf:li>Burton< /rdf:li>< rdf:li>Wake up< /rdf:li>< /rdf:Bag>

< /dc:subject>< /rdf:Description>


Now the above XML suggests that the image is tagged with 4 tags (Wake up,Blinx,Banking,Burton).

After tagging, I run an indexing code and create a list of files with the tags. The produced output was like following :


< ?xml version="1.0" encoding="UTF-8"?>

< Files>

< File Name="imageName3.png">

< Keyword>Banking< /Keyword>
< Keyword>Sports< /Keyword>

< /File>

< File Name="imageName2.png">

< Keyword>Banking< /Keyword>
< Keyword>AssetManagement< /Keyword>
< Keyword>Sports< /Keyword>

< /File>

< File Name="imageName1.png">

< Keyword>Banking< /Keyword>
< Keyword>AssetManagement< /Keyword>
< Keyword>Sports< /Keyword>

< /File>
< /Files>


Now whenever user will enter a keyword in my search panel, I will just load the items from XML in the Panel and will display the images in a different thread.

HTH,
Vikas Bhandari

No comments: