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
  #1  
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
  #2  
Old 04-20-2007, 08:53 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
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  
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  
Old 04-24-2007, 03:35 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
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  
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  
Old 04-24-2007, 07:16 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
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  
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  
Old 04-27-2007, 03:09 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
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  
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  
Old 04-28-2007, 12:42 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
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
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 Off
Pingbacks are Off
Refbacks are Off

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 12:25 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
Stamford Dentist | Euro Millions Lottery | Tech Support Services

SEO by vBSEO 3.0.0