Click here to Skip to main content
15,908,776 members
Articles / Programming Languages / Visual Basic
Article

The ExifWorks class

Rate me:
Please Sign up or sign in to vote.
4.43/5 (27 votes)
1 Feb 2006MIT2 min read 333.3K   8.9K   87   83
The ExifWorks is a class written in 100% pure managed VB.NET, which allows comfortable reading of embedded EXIF metadata.

What is EXIF

EXIF stands for Exchangeable Image File Format. This format is used for storing various metadata in images, and is widely used mainly in digital still cameras. More information about EXIF can be found here, or in the document Description of the EXIF file format by TsuruZoh Tachibanaya.

When I was trying to find any sources regarding comfort access from .NET environment to these data, I was not successful. So I wrote this class and gave it freely available as open source.

What is ExifWorks

ExifWorks is a class written in 100% pure managed VB.NET, which allows comfort reading and writing of embedded EXIF metadata. It has the following features:

  • Provides the TagNames Enum, which contains user-friendly constant names for all known EXIF parameter IDs.
  • Provides generic functions for reading EXIF parameters: GetInt16, GetInt32, GetString, and GetRational, as well as GetPropertyInt16, GetPropertyInt32, GetPropertyString, and GetPropertyRational. They may be used to simplify the access to all EXIF data from your custom application.
  • Provides a user-friendly abstraction layer for most of the common parameters, allowing easy work with EXIF data and their presentation to end users. The abstraction layer has been developed for presentation, so even if a value is not present, some data (in valid syntax) are provided. Either default values or values computed from other sources (i.e. shutter speed vs. exposure time) are provided. If you need exact data, use the generic functions instead.

The provided test application exread.exe shows working with the ExifWorks class.

Licensing

ExifReader/ExifWorks .NET library

Copyright (c) Michal A. Valášek - Altair Communícations, 2003-2006

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

The text of the GNU Lesser General Public License (LGPL) is available online here.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer Altairis
Czech Republic Czech Republic

Software architect and developer in Altairis, dev shop in Czech republic. Microsoft Most Valuable Professional (MVP) since 2004.


See my open source project at Codeplex.


Comments and Discussions

 
GeneralRe: Performance improvement (x20) Pin
Mark Gray25-Nov-09 13:32
Mark Gray25-Nov-09 13:32 
GeneralUTF8 Pin
waimoehtun25-Jan-07 2:01
waimoehtun25-Jan-07 2:01 
QuestionHow to write tags Pin
dalib24-Jan-07 4:56
dalib24-Jan-07 4:56 
AnswerRe: How to write tags Pin
Sdolby7-Jun-16 4:58
Sdolby7-Jun-16 4:58 
GeneralAnybody extracted the MakerNotes Pin
Andy Hollis18-Jan-07 10:14
Andy Hollis18-Jan-07 10:14 
GeneralUsing Exif Works on Raw files... Pin
Mike Allgood20-Dec-06 9:36
Mike Allgood20-Dec-06 9:36 
GeneralC# version Pin
m.ridoni2-Nov-06 8:32
m.ridoni2-Nov-06 8:32 
Generalhelp please with display code Pin
markoliverreally21-Oct-06 11:32
markoliverreally21-Oct-06 11:32 
Hi there
I downloaded and added your nice ExifWorks class to my project.

what code do I need to use to have an exif field display?
the click method I tried was as follows:
*******************************************

Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'declare pic,dir, and thepic as strings
Dim pic As String
Dim dir As String
Dim thepic As String

'adds .jpg to the file name and assigns the directory path
dir = "C:\Documents and Settings\Mark\Desktop\VBPix\"
pic = txtPhoto.Text & ".jpg"

'concatenates the entire directory path
thepic = dir & pic

' sees if the file exists
If My.Computer.FileSystem.FileExists(thepic) Then
MsgBox("file found")


'THIS IS THE LINE I NEED HELP WITH!!!

lblExif.Text = ExifWorks.TagNames.Artist.ToString

' !!!!!!!!!!!!!!!!!!!!!!!!

' display the selected photo
picPhoto.Image = System.Drawing.Bitmap.FromFile(thepic)


Else
MsgBox("File not found.")
End If



******************************************
but it only says, Artist.

Of course, I'd prefer the name of the Artist, or whatever field it is to be displayed rather than the name ofthe field itself.

thanks so much, and I know this is pretty basic stuff.

cheers
Mark



GeneralGPS Propertys Pin
goldini200311-Oct-06 11:23
goldini200311-Oct-06 11:23 
QuestionWrong numbers ... Pin
Dammark2-May-06 11:11
Dammark2-May-06 11:11 
QuestionRe: Wrong numbers ... Pin
amanitamuscaria20-Aug-07 14:28
amanitamuscaria20-Aug-07 14:28 
AnswerRe: Wrong numbers ... Pin
HabKeinen2-Oct-07 13:37
HabKeinen2-Oct-07 13:37 
AnswerRe: Wrong numbers ... Pin
Fabian Tuender27-Nov-07 9:47
Fabian Tuender27-Nov-07 9:47 
GeneralWriting data Pin
Paul Suart15-Mar-06 10:01
Paul Suart15-Mar-06 10:01 
AnswerRe: Writing data Pin
RootThor31-Mar-06 5:04
RootThor31-Mar-06 5:04 
GeneralRe: Writing data Pin
Rook6928-Mar-08 16:53
Rook6928-Mar-08 16:53 
GeneralDreamweaver / ASP Pin
TrevorHawes15-Oct-03 13:48
TrevorHawes15-Oct-03 13:48 
GeneralOther articles Pin
Richard Deeming15-Sep-03 23:29
mveRichard Deeming15-Sep-03 23:29 
GeneralRe: Other articles Pin
Michal Altair Valášek16-Sep-03 0:09
Michal Altair Valášek16-Sep-03 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.