Click here to Skip to main content
Licence 
First Posted 8 Sep 2003
Views 150,206
Downloads 1,577
Bookmarked 74 times

The ExifWorks class

By Michal Altair Valášek | 1 Feb 2006
The ExifWorks is a class written in 100% pure managed VB.NET, which allows comfortable reading of embedded EXIF metadata.

1

2
1 vote, 4.5%
3
4 votes, 18.2%
4
17 votes, 77.3%
5
4.79/5 - 22 votes
1 removed
μ 4.37, σa 0.98 [?]

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Michal Altair Valášek

Software Developer
Altairis
Czech Republic Czech Republic

Member

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.



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 PinmemberMohammad_02123:24 12 Nov '11  
QuestionEXIF GPS Latitude and others Pinmemberbridgfod18:20 13 Aug '11  
AnswerRe: EXIF GPS Latitude and others Pinmemberbridgfod3:21 15 Aug '11  
GeneralAltitude and ImgDir PinmemberJustinMW11:54 12 Nov '10  
QuestionExifWorks Subject Distance PinmemberArchdeacon23:56 4 Sep '10  
AnswerRe: ExifWorks Subject Distance PinmemberMember 18154704:12 28 Sep '11  
GeneralMy vote of 4 PinmemberArchit93732844488:44 24 Jul '10  
GeneralSaving edits Pinmembercalipo7:09 19 Aug '09  
GeneralRe: Saving edits PinmemberDrew Stegon12:16 19 Aug '09  
Just made mine work. It is a bit crazy, but seems to be the only way to make it work.
 
'load image into exif
Dim ef As New ExifWorks(PicPath)
 
'make changes to image as nec
ef.orientation= newor
 
'create temp image path
dim NewTempPicPath as string = samedirectory & filename & "_temp" & samefileext
 
'dim image as the _image from exifworks (make it public - comes private)
Dim imgWithExif As Image = ef._Image
 
imgWithExif.save(NewTempPicPath)
 
'now that the update image is saved
ef.dispose
 
'now delete original
.deletefile(PicPath)
'now copy temp file back to orig name
.copyfile(NewTempPicPath,PicPath)
'now delete temp file
'deletefile(NewTempPicPath)
 

Finally got it to work for me! had to change the setproperty method in the exif form to set teh proprtyID to the one that is being changed, but after that it worked great
GeneralRe: Saving edits Pinmemberx38class21:26 23 Sep '09  
GeneralRe: Saving edits PinmemberDrew Stegon7:13 24 Sep '09  
GeneralRe: Saving edits Pinmemberemompong17:33 17 Feb '10  
QuestionHow to set / write "rational-data" like latitude / longitude ? [modified] Pinmemberscooterdd1:35 14 Aug '09  
AnswerRe: How to set / write "rational-data" like latitude / longitude ? PinmemberDrew Stegon18:28 19 Aug '09  
QuestionAny way to write tags Pinmembergerardkelly8:03 21 Jul '09  
GeneralCannot save ISO info Pinmemberwaex9922:59 25 Jun '09  
GeneralEXIF Thumbnail PinmemberScott Rippey10:50 21 Jun '09  
GeneralRe: EXIF Thumbnail PinmemberDrew Stegon6:57 17 Aug '09  
AnswerRe: EXIF Thumbnail PinmemberScott Rippey9:29 17 Aug '09  
GeneralRe: EXIF Thumbnail PinmemberDrew Stegon14:18 18 Aug '09  
GeneralRe: EXIF Thumbnail PinmemberScott Rippey21:05 18 Aug '09  
GeneralRe: EXIF Thumbnail PinmemberDrew Stegon12:04 19 Aug '09  
GeneralRe: EXIF Thumbnail PinmemberDrew Stegon14:37 18 Aug '09  
Generalc# version with GPS feature (latitude, longitude) PinmemberMember 425991923:41 19 Jun '09  
GeneralOverwrite the existing file when saving. PinmemberMember 417568311:28 11 Jun '09  

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

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120210.1 | Last Updated 1 Feb 2006
Article Copyright 2003 by Michal Altair Valášek
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid