IT Community - Software Programming, Web Development and Technical Support

Extract IPTC Metadata from jpeg and tiff image formats

This is a discussion on Extract IPTC Metadata from jpeg and tiff image formats within the C# Programming forums, part of the Software Development category; Hi, I am doing a project to extract IPTC metadata from jpg and tiff image formats. Then i want to ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 04-18-2007, 11:22 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Extract IPTC Metadata from jpeg and tiff image formats

Hi,

I am doing a project to extract IPTC metadata from jpg and tiff image formats. Then i want to edit the data and save it. Can anyone tell me how to do it?

Thanks...

S.Balasubramanian..

Last edited by Booom : 08-22-2007 at 11:31 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-20-2007, 08:53 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

There are lot of components are avaiable for the meta data extractor from the image file.

IPTCInfo

The IPTCInfo module allows you to add/edit metadata
to your image. You can download it from here.

Reading
from iptcinfo import IPTCInfo
info = IPTCInfo('test.jpg')
print info.keywords, info.supplementalCategories, info.contacts
caption = info.data['caption/abstract']
Add/Edit
info = IPTCInfo('test.jpg')
info.data['caption/abstract'] = 'Witty caption here'
info.data['supplemental category'] = ['portrait']
info.save()
info.saveAs('test_out.jpg') # keep original safe
And also

ImageMagick

ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick (Neko/haXe), MagickNet (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically.


thanks
__________________
Karpagarajan. R
Necessity is the mother of invention

Last edited by Booom : 08-20-2007 at 02:13 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-23-2007, 11:19 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

Iam unable to download the source file from the link that you have sent. Please send me that module if you have.

Thanks,

S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-24-2007, 03:35 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Hi Balasubramanian,

Here is the link to download the ImageMagick for Windows

And the sample source code for .NET Class

and the VC++ source code

The Technical Documentation

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2007, 05:53 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

I have downloaded the source from the link that you have sent. But all are in VC++ or C. I want to extract IPTC Metadata using C#. Please can you tell me any idea...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-24-2007, 07:16 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Yes Balasubramanian,

You need to use the same code how the ImageMagick Component was used in the sample code. You just implement the ImageMagick library in your C# source file and use ImageMagick functionality. try this with your source

I will implement it in a sample file and let you know ..

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-25-2007, 04:36 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

Iam unable to add the dll file (imageMagick) as a reference in my c# project.

I have a full source to read and write IPTC MetaData in VC++. But I want to do it in C#. So, I want to convert the VC++ source into DLL and use it in C#. Could you please tell me how to convert and use?

Extracting IPTC header information from JPEG images - The Code Project - Bitmaps & Palettes

Thanks...

S.Balasubramanian.

Last edited by Balasubramanian.S : 04-26-2007 at 02:55 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-27-2007, 03:09 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Default Re: Extract Meta Data from images

Hi..Balasubramanian..

I have gone throught that code. I think you can straighaway link the "IPTC.cpp" and "IPTC.h" on to your C# project. these files are used to define the "CIPTC" class. Using the CIPTC class you can extract the IPTC information.
After check with the given sample URL, I have described the following logic to extract the IPTC information.

first insert the following files to your C# project.(download the source file from URL which you posted in previous message)
"IPTC.cpp"
"IPTC.h"
CIPTC m_iptc;


declare the variable like that and use the object in the following manner to assign the IPTC information to your variables.
m_iptc.OpenFile(m_FileName);

m_Byline = m_iptc.m_Byline;
m_BylineTitle = m_iptc.m_BylineTitle;
m_Caption = m_iptc.m_Caption;
m_CaptionWriter = m_iptc.m_CaptionWriter;
m_City = m_iptc.m_City;
m_Country = m_iptc.m_Country;
m_Credits = m_iptc.m_Credits;
m_DateCreated = m_iptc.m_DateCreated;
m_Headline = m_iptc.m_Headline;
m_ObjectName = m_iptc.m_ObjectName;
m_OrigTC = m_iptc.m_OriginalTransmissionReference;
m_Source = m_iptc.m_Source;
m_SpecInstructions = m_iptc.m_SpecialInstructions;
m_State = m_iptc.m_State;
m_Category = m_iptc.m_Category;
m_CopyrightNotice = m_iptc.m_CopyrightNotice;

for(i=0;i<=m_iptc.m_SupplementalCategories.GetUppe rBound();i++)
m_SupCat.AddString(m_iptc.m_SupplementalCategories .GetAt(i));

for(i=0;i<=m_iptc.m_Keywords.GetUpperBound();i++)
m_Keywords.AddString(m_iptc.m_Keywords.GetAt(i));
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-27-2007, 09:42 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

When I add, IPTC.CPP and IPTC.h in my C# application. The following error occured.

The type or namespace CIPTC could not be found(are you missing an assembly directive).

Could you please help me how to solve the problem.

Thanks,

S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-28-2007, 12:42 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Hi Balasubramanian,

since i was working in another project, I couldnt get the solution yet. But I have searched in the net and find another way to get the IPTC data in C#. Kindly go through this sample and let me know the status.

IPTC in C#

And also, Bala do you have the BitmapMetadata

use codes from here: IPTC Codes

with

BitmapMetadata meta = (BitmapMetadata)myDecoder.Frames[0].Metadata;

MyInfo = meta.GetQuery("/app13/ifb/8bimiptc/WHATEVER") ;


thanks
__________________
Karpagarajan. R
Necessity is the mother of invention

Last edited by Karpagarajan : 04-28-2007 at 12:47 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 04-29-2007, 10:31 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

I checked the samples that you have sent yesterday. I already have this sample. This sample is used to extract the IPTC MetaData from jpg file only. I want to extract, edit and save the IPTC Metadata for JPG, and TIFF file.
I have no samples in C# to edit the IPTC MetaData. Please give some idea.

Thanks,

S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 04-30-2007, 12:33 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Yes Balasubramanian,

I think we cannot edit the IPTC datas on image file. We can only extract the datas and use it for other purposes. I dont think, but it can be available on the net.

When going with the thrid party components(Extractor), I dont think it is not that much easier to do all the image operations. You can just get the File stream structure of the JPEG file (it will be available on the net for Joint Photographic Experts Group). And use that Stream object for extracting / editing the meta data information.

I will also search or do some R & D works regarding this and let u know before this evening.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention

Last edited by Karpagarajan : 04-30-2007 at 12:37 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 04-30-2007, 09:42 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Hi Balasubramanian,

I have given the sample R & D works i had done in IPTC. Just include this dll and use the namespace as in the following manner.(I just given the vb code)
Dim a As New IPTCObj
Dim b As String
Call a.GetIPTCData(Text1.Text, b)
MsgBox b
I just wrote the function for getting the IPTC data. It is possible to write the IPTC data onto the image. Hope it will be helpful for you. And if you want the save functionality also, i will give. Let me know. thanks.

thanks
Attached Files
File Type: zip IPTC.zip (42.7 KB, 742 views)
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 05-02-2007, 03:11 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

I am trying to add as a reference a dll that you have sent. But the following error occurs while registering the DLL using RegSvr32.

LoadLibrary("NewIptc.dll") failed.The specified module could not be found.
Please help me to solve the problem..

Thanks...

S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 05-03-2007, 04:39 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Hi balasubramanian,

I couldnt get the error when i tried to implement it in the another system - vb project. Its working fine.

Do you have any option in C# to include this dll to your project?

I dont know the exact procedure. this module should not be registered.

I will let u know

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 05-06-2007, 11:22 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Red face Re: Extract Meta Data from images

Hi Karpagarajan,

I have to Register this DLL using Regsvr32 to use it in C# Project. Please tell me whether it is a managed DLL or unmanaged DLL. Please send me the VB project that you have implemented this DLL.

Thanks..
S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 05-08-2007, 10:03 PM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

I can read the IPTC metadata from the DLL that you have sent. But, I can't write the IPTC medata using this dll. Please help me to write the IPTC metadata.


Thanks...
S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 05-09-2007, 06:15 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: Extract Meta Data from images

Hi balasubramanian,

Here I have attached the vc++ dll source file for reading and saving the IPTC data on to the image file.

Hope it will be useful for you.. let me know the feedback..

thanks
Attached Files
File Type: zip NewIPTCSave.zip (35.9 KB, 562 views)
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 05-09-2007, 07:22 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: Extract Meta Data from images

Hi Karpagarajan,

I checked the dll that you have sent now. It is working fine.

Thanks...

S.Balasubramanian.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 08-22-2007, 06:51 AM
Booom Booom is offline
Administrator
 
Join Date: Feb 2007
Posts: 74
Booom is on a distinguished road
Default Re: Extract Meta Data from images

Very good contribution has been made to this thread and so ive made this thread sticky.

Good Luck and continue quality content posting in this thread regularly because our goal must be to get the 1st result in search engines when searched for extract iptc metadata or extract metadata or extract iptc metadata using c# etc.,

Thanks
__________________
Vinoth Chandar
Creator of Discussweb
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-programming/1113-extract-iptc-metadata-jpeg-tiff-image-formats.html
Posted By For Type Date
C# Programming [Archive] - DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 03-04-2008 02:37 AM
Microsoft Photography & Video Blog : Metadata and the Windows Vista Photo Gallery This thread Refback 08-20-2007 02:16 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading EXIF, IPTC & ICC Profile metadata from an image using MagickNet in C# letmein C# Programming 0 03-27-2008 12:42 AM
Applying ICC profiles to a TIFF,JPEG files using C# oxygen C# Programming 1 02-28-2008 10:42 PM
Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C# oxygen C# Programming 1 02-28-2008 10:33 PM
Read and Write IPTC and EXIF metadata fro raw Images Balasubramanian.S C# Programming 4 08-03-2007 06:38 AM
I have a C source to write iptc and exif metadata for raw images. How to use it in C# oxygen C# Programming 0 07-21-2007 01:56 AM


All times are GMT -7. The time now is 02:35 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
Miami FL Divorce Lawyers      Pittsburgh Personal Injury Law      Austin TX Auto Accident Lawyer
Sedo - Buy and Sell Domain Names and Websites project info: discussweb.com Statistics for project discussweb.com etracker® web controlling instead of log file analysis

SEO by vBSEO 3.0.0