IT Community - Software Programming, Web Development and Technical Support

Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C#

This is a discussion on Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C# within the C# Programming forums, part of the Software Development category; Reading and Writing IPTC Metadata using Adobe Photoshop DLL. Goals: This project is used to read and write IPTC and ...


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

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-19-2007, 11:13 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C#

Reading and Writing IPTC Metadata using Adobe Photoshop DLL.

Goals:

This project is used to read and write IPTC and EXIF metadata.


Steps:

1) Create a C# project.

2) Create two button control one for read and another for write.

3) Add the reference of Adobe Photoshop Dll.

4) Add the following namespace.

using Photoshop;

5) copy the following code.

Photoshop.Document ps;
Photoshop.Application app;
Photoshop.DocumentInfo psi;
Photoshop.JPEGSaveOptionsClass jpgs;
Photoshop.TiffSaveOptionsClass tiffs;

6)In the Read button control, Copy the following code.


string iptc = "";
textBox1.Text = openFileDialog1.FileName;
app = new Photoshop.ApplicationClass();
app.Visible = false;
app.DisplayDialogs = PsDialogModes.psDisplayNoDialogs;
app.Application.Visible = false;
ps = app.Open(openFileDialog1.FileName, null);
//app.ActiveDocument = ps;

foreach (Photoshop.ArtLayer artlayerRef in ps.ArtLayers)
{
artlayerRef.Visible = false;
}

//ps.SaveAs("D:\\psaveimage", jpgs, null,2);
psi = ps.Info;

iptc = psi.Author.ToString() + "|";
iptc += psi.AuthorPosition.ToString() + "|";
iptc += psi.Caption.ToString() + "|";
iptc += psi.CaptionWriter.ToString() + "|";
iptc += psi.Category.ToString() + "|";
iptc += psi.City.ToString() + "|";
iptc += psi.CopyrightNotice.ToString() + "|";
iptc += psi.Country.ToString() + "|";
iptc += psi.CreationDate.ToString() + "|";
iptc += psi.Credit.ToString() + "|";
iptc += psi.Headline.ToString() + "|";
iptc += psi.Instructions.ToString() + "|";
iptc += psi.JobName.ToString() + "|";
//iptc += psi.Keywords.ToString() + "|";
iptc += psi.OwnerUrl.ToString() + "|";
iptc += psi.ProvinceState.ToString() + "|";
iptc += psi.Source.ToString() + "|";
//iptc += psi.SupplementalCategories.ToString() + "|";
iptc += psi.Title.ToString() + "|";
iptc += psi.TransmissionReference.ToString() + "|";
iptc += psi.Urgency.ToString() + "|";

MessageBox.Show(iptc);
object obj = new object();
obj = psi.EXIF;
MessageBox.Show(obj.ToString());

7) In the write button control, Copy the following code.

ps.Info.Copyrighted = Photoshop.PsCopyrightedType.psCopyrightedWork;
ps.Info.CopyrightNotice = "Bala@Pdi";
ps.Info.City = "Chennai";
ps.Info.Caption = "Bala";
ps.Info.Author = "Balasubramanian.S";
ps.Info.Category = "MetaData";
ps.Info.CaptionWriter = "SBala";
ps.Info.Country = "India";
ps.Info.CreationDate = "06/14/2007";
ps.Info.Headline = "IPTC";
ps.Info.Title = "IPTC Check";
ps.Info.Urgency= PsUrgency.psSeven;
ps.Save();
ps.Close(null);
ps = null;
app.Quit();
app = null;
MessageBox.Show("Data Writed Successfully");
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-28-2008, 10:33 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Exclamation Re: Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in

Hi,
Can I read and write all EXIF,IPTC metadata from the images with this application?Is it possible to read and write metada from the RAW image files as well? Thanks in advance.
__________________
Sathish Kumar.R
Knowledge is meant to SHARE
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract IPTC Metadata from jpeg and tiff image formats Balasubramanian.S C# Programming 25 09-17-2008 11:59 PM
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
Converting Nikon camera RAW images to JPEG,TIFF files using Adobe dll in C#.NET oxygen C# Programming 5 08-16-2007 02:26 AM
Reading and writing EXIF meta data from jpg/jpeg,tiff images oxygen C# Programming 0 07-15-2007 10:24 PM


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


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0