Click here to Skip to main content
16,011,949 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 342.4K   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
Member 459992410-Dec-07 3:28
Member 459992410-Dec-07 3:28 
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 PinPopular
m.ridoni2-Nov-06 8:32
m.ridoni2-Nov-06 8:32 
This is a C# version of the same code:

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace ExifWorks<br />
{<br />
    // <summary><br />
    // Utility class for working with EXIF data in images. Provides abstraction<br />
    // for most common data and generic utilities for work with all other. <br />
    // </summary><br />
    // <remarks><br />
    // Copyright (c) Michal A. Valášek - Altair Communications, 2003-2005<br />
    // Copmany: http://software.altaircom.net, E-mail: support@altaircom.net<br />
    // Private: http://www.rider.cz, E-mail: rider@rider.cz<br />
    // This is free software licensed under GNU Lesser General Public License<br />
    // </remarks><br />
    // <history><br />
    // [altair] 10.09.2003 Created<br />
    // [altair] 12.06.2004 Added capability to write EXIF data<br />
    // [altair] 11.07.2004 Added option to change encoding<br />
    // [altair] 04.09.2005 Changed source of Width and Height properties from EXIF to image<br />
    // [altair] 05.09.2005 Code clean-up and minor changes<br />
    // [marco.ridoni@virgilio.it] 02-11-2006 C# translation<br />
    // </history><br />
    public class ExifManager : IDisposable<br />
    {<br />
<br />
        private System.Drawing.Bitmap _Image;<br />
        private System.Text.Encoding _Encoding = System.Text.Encoding.UTF8;<br />
<br />
        #region Type declarations<br />
<br />
        // <summary><br />
        // Contains possible values of EXIF tag names (ID)<br />
        // </summary><br />
        // <remarks>See GdiPlusImaging.h</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum TagNames : int<br />
        {<br />
            ExifIFD = 0x8769,<br />
            GpsIFD = 0x8825,<br />
            NewSubfileType = 0xFE,<br />
            SubfileType = 0xFF,<br />
            ImageWidth = 0x100,<br />
            ImageHeight = 0x101,<br />
            BitsPerSample = 0x102,<br />
            Compression = 0x103,<br />
            PhotometricInterp = 0x106,<br />
            ThreshHolding = 0x107,<br />
            CellWidth = 0x108,<br />
            CellHeight = 0x109,<br />
            FillOrder = 0x10A,<br />
            DocumentName = 0x10D,<br />
            ImageDescription = 0x10E,<br />
            EquipMake = 0x10F,<br />
            EquipModel = 0x110,<br />
            StripOffsets = 0x111,<br />
            Orientation = 0x112,<br />
            SamplesPerPixel = 0x115,<br />
            RowsPerStrip = 0x116,<br />
            StripBytesCount = 0x117,<br />
            MinSampleValue = 0x118,<br />
            MaxSampleValue = 0x119,<br />
            XResolution = 0x11A,<br />
            YResolution = 0x11B,<br />
            PlanarConfig = 0x11C,<br />
            PageName = 0x11D,<br />
            XPosition = 0x11E,<br />
            YPosition = 0x11F,<br />
            FreeOffset = 0x120,<br />
            FreeByteCounts = 0x121,<br />
            GrayResponseUnit = 0x122,<br />
            GrayResponseCurve = 0x123,<br />
            T4Option = 0x124,<br />
            T6Option = 0x125,<br />
            ResolutionUnit = 0x128,<br />
            PageNumber = 0x129,<br />
            TransferFuncition = 0x12D,<br />
            SoftwareUsed = 0x131,<br />
            DateTime = 0x132,<br />
            Artist = 0x13B,<br />
            HostComputer = 0x13C,<br />
            Predictor = 0x13D,<br />
            WhitePoint = 0x13E,<br />
            PrimaryChromaticities = 0x13F,<br />
            ColorMap = 0x140,<br />
            HalftoneHints = 0x141,<br />
            TileWidth = 0x142,<br />
            TileLength = 0x143,<br />
            TileOffset = 0x144,<br />
            TileByteCounts = 0x145,<br />
            InkSet = 0x14C,<br />
            InkNames = 0x14D,<br />
            NumberOfInks = 0x14E,<br />
            DotRange = 0x150,<br />
            TargetPrinter = 0x151,<br />
            ExtraSamples = 0x152,<br />
            SampleFormat = 0x153,<br />
            SMinSampleValue = 0x154,<br />
            SMaxSampleValue = 0x155,<br />
            TransferRange = 0x156,<br />
            JPEGProc = 0x200,<br />
            JPEGInterFormat = 0x201,<br />
            JPEGInterLength = 0x202,<br />
            JPEGRestartInterval = 0x203,<br />
            JPEGLosslessPredictors = 0x205,<br />
            JPEGPointTransforms = 0x206,<br />
            JPEGQTables = 0x207,<br />
            JPEGDCTables = 0x208,<br />
            JPEGACTables = 0x209,<br />
            YCbCrCoefficients = 0x211,<br />
            YCbCrSubsampling = 0x212,<br />
            YCbCrPositioning = 0x213,<br />
            REFBlackWhite = 0x214,<br />
            ICCProfile = 0x8773,<br />
            Gamma = 0x301,<br />
            ICCProfileDescriptor = 0x302,<br />
            SRGBRenderingIntent = 0x303,<br />
            ImageTitle = 0x320,<br />
            Copyright = 0x8298,<br />
            ResolutionXUnit = 0x5001,<br />
            ResolutionYUnit = 0x5002,<br />
            ResolutionXLengthUnit = 0x5003,<br />
            ResolutionYLengthUnit = 0x5004,<br />
            PrintFlags = 0x5005,<br />
            PrintFlagsVersion = 0x5006,<br />
            PrintFlagsCrop = 0x5007,<br />
            PrintFlagsBleedWidth = 0x5008,<br />
            PrintFlagsBleedWidthScale = 0x5009,<br />
            HalftoneLPI = 0x500A,<br />
            HalftoneLPIUnit = 0x500B,<br />
            HalftoneDegree = 0x500C,<br />
            HalftoneShape = 0x500D,<br />
            HalftoneMisc = 0x500E,<br />
            HalftoneScreen = 0x500F,<br />
            JPEGQuality = 0x5010,<br />
            GridSize = 0x5011,<br />
            ThumbnailFormat = 0x5012,<br />
            ThumbnailWidth = 0x5013,<br />
            ThumbnailHeight = 0x5014,<br />
            ThumbnailColorDepth = 0x5015,<br />
            ThumbnailPlanes = 0x5016,<br />
            ThumbnailRawBytes = 0x5017,<br />
            ThumbnailSize = 0x5018,<br />
            ThumbnailCompressedSize = 0x5019,<br />
            ColorTransferFunction = 0x501A,<br />
            ThumbnailData = 0x501B,<br />
            ThumbnailImageWidth = 0x5020,<br />
            ThumbnailImageHeight = 0x502,<br />
            ThumbnailBitsPerSample = 0x5022,<br />
            ThumbnailCompression = 0x5023,<br />
            ThumbnailPhotometricInterp = 0x5024,<br />
            ThumbnailImageDescription = 0x5025,<br />
            ThumbnailEquipMake = 0x5026,<br />
            ThumbnailEquipModel = 0x5027,<br />
            ThumbnailStripOffsets = 0x5028,<br />
            ThumbnailOrientation = 0x5029,<br />
            ThumbnailSamplesPerPixel = 0x502A,<br />
            ThumbnailRowsPerStrip = 0x502B,<br />
            ThumbnailStripBytesCount = 0x502C,<br />
            ThumbnailResolutionX = 0x502D,<br />
            ThumbnailResolutionY = 0x502E,<br />
            ThumbnailPlanarConfig = 0x502F,<br />
            ThumbnailResolutionUnit = 0x5030,<br />
            ThumbnailTransferFunction = 0x5031,<br />
            ThumbnailSoftwareUsed = 0x5032,<br />
            ThumbnailDateTime = 0x5033,<br />
            ThumbnailArtist = 0x5034,<br />
            ThumbnailWhitePoint = 0x5035,<br />
            ThumbnailPrimaryChromaticities = 0x5036,<br />
            ThumbnailYCbCrCoefficients = 0x5037,<br />
            ThumbnailYCbCrSubsampling = 0x5038,<br />
            ThumbnailYCbCrPositioning = 0x5039,<br />
            ThumbnailRefBlackWhite = 0x503A,<br />
            ThumbnailCopyRight = 0x503B,<br />
            LuminanceTable = 0x5090,<br />
            ChrominanceTable = 0x5091,<br />
            FrameDelay = 0x5100,<br />
            LoopCount = 0x5101,<br />
            PixelUnit = 0x5110,<br />
            PixelPerUnitX = 0x5111,<br />
            PixelPerUnitY = 0x5112,<br />
            PaletteHistogram = 0x5113,<br />
            ExifExposureTime = 0x829A,<br />
            ExifFNumber = 0x829D,<br />
            ExifExposureProg = 0x8822,<br />
            ExifSpectralSense = 0x8824,<br />
            ExifISOSpeed = 0x8827,<br />
            ExifOECF = 0x8828,<br />
            ExifVer = 0x9000,<br />
            ExifDTOrig = 0x9003,<br />
            ExifDTDigitized = 0x9004,<br />
            ExifCompConfig = 0x9101,<br />
            ExifCompBPP = 0x9102,<br />
            ExifShutterSpeed = 0x9201,<br />
            ExifAperture = 0x9202,<br />
            ExifBrightness = 0x9203,<br />
            ExifExposureBias = 0x9204,<br />
            ExifMaxAperture = 0x9205,<br />
            ExifSubjectDist = 0x9206,<br />
            ExifMeteringMode = 0x9207,<br />
            ExifLightSource = 0x9208,<br />
            ExifFlash = 0x9209,<br />
            ExifFocalLength = 0x920A,<br />
            ExifMakerNote = 0x927C,<br />
            ExifUserComment = 0x9286,<br />
            ExifDTSubsec = 0x9290,<br />
            ExifDTOrigSS = 0x9291,<br />
            ExifDTDigSS = 0x9292,<br />
            ExifFPXVer = 0xA000,<br />
            ExifColorSpace = 0xA001,<br />
            ExifPixXDim = 0xA002,<br />
            ExifPixYDim = 0xA003,<br />
            ExifRelatedWav = 0xA004,<br />
            ExifInterop = 0xA005,<br />
            ExifFlashEnergy = 0xA20B,<br />
            ExifSpatialFR = 0xA20C,<br />
            ExifFocalXRes = 0xA20E,<br />
            ExifFocalYRes = 0xA20F,<br />
            ExifFocalResUnit = 0xA210,<br />
            ExifSubjectLoc = 0xA214,<br />
            ExifExposureIndex = 0xA215,<br />
            ExifSensingMethod = 0xA217,<br />
            ExifFileSource = 0xA300,<br />
            ExifSceneType = 0xA301,<br />
            ExifCfaPattern = 0xA302,<br />
            GpsVer = 0x0,<br />
            GpsLatitudeRef = 0x1,<br />
            GpsLatitude = 0x2,<br />
            GpsLongitudeRef = 0x3,<br />
            GpsLongitude = 0x4,<br />
            GpsAltitudeRef = 0x5,<br />
            GpsAltitude = 0x6,<br />
            GpsGpsTime = 0x7,<br />
            GpsGpsSatellites = 0x8,<br />
            GpsGpsStatus = 0x9,<br />
            GpsGpsMeasureMode = 0xA,<br />
            GpsGpsDop = 0xB,<br />
            GpsSpeedRef = 0xC,<br />
            GpsSpeed = 0xD,<br />
            GpsTrackRef = 0xE,<br />
            GpsTrack = 0xF,<br />
            GpsImgDirRef = 0x10,<br />
            GpsImgDir = 0x11,<br />
            GpsMapDatum = 0x12,<br />
            GpsDestLatRef = 0x13,<br />
            GpsDestLat = 0x14,<br />
            GpsDestLongRef = 0x15,<br />
            GpsDestLong = 0x16,<br />
            GpsDestBearRef = 0x17,<br />
            GpsDestBear = 0x18,<br />
            GpsDestDistRef = 0x19,<br />
            GpsDestDist = 0x1A<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Real position of 0th row and column of picture<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum Orientations<br />
        {<br />
            TopLeft = 1,<br />
            TopRight = 2,<br />
            BottomRight = 3,<br />
            BottomLeft = 4,<br />
            LeftTop = 5,<br />
            RightTop = 6,<br />
            RightBottom = 7,<br />
            LftBottom = 8<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Exposure programs<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum ExposurePrograms<br />
        {<br />
            Manual = 1,<br />
            Normal = 2,<br />
            AperturePriority = 3,<br />
            ShutterPriority = 4,<br />
            Creative = 5,<br />
            Action = 6,<br />
            Portrait = 7,<br />
            Landscape = 8,<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Exposure metering modes<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum ExposureMeteringModes<br />
        {<br />
            Unknown = 0,<br />
            Average = 1,<br />
            CenterWeightedAverage = 2,<br />
            Spot = 3,<br />
            MultiSpot = 4,<br />
            MultiSegment = 5,<br />
            Partial = 6,<br />
            Other = 255<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Flash activity modes<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum FlashModes<br />
        {<br />
            NotFired = 0,<br />
            Fired = 1,<br />
            FiredButNoStrobeReturned = 5,<br />
            FiredAndStrobeReturned = 7,<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Possible light sources (white balance)<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
<br />
        public enum LightSources<br />
        {<br />
            Unknown = 0,<br />
            Daylight = 1,<br />
            Fluorescent = 2,<br />
            Tungsten = 3,<br />
            Flash = 10,<br />
            StandardLightA = 17,<br />
            StandardLightB = 18,<br />
            StandardLightC = 19,<br />
            D55 = 20,<br />
            D65 = 21,<br />
            D75 = 22,<br />
            Other = 255<br />
        }<br />
<br />
<br />
        // <summary><br />
        // EXIF data types<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 12.6.2004 Created<br />
        // </history><br />
        public enum ExifDataTypes : short<br />
        {<br />
            UnsignedByte = 1,<br />
            AsciiString = 2,<br />
            UnsignedShort = 3,<br />
            UnsignedLong = 4,<br />
            UnsignedRational = 5,<br />
            SignedByte = 6,<br />
            Undefined = 7,<br />
            SignedShort = 8,<br />
            SignedLong = 9,<br />
            SignedRational = 10,<br />
            SingleFloat = 11,<br />
            DoubleFloat = 12<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Represents rational which is type of some Exif properties<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public struct Rational<br />
        {<br />
            public Int32 Numerator;<br />
            public Int32 Denominator;<br />
<br />
<br />
            // <summary><br />
            // Converts rational to string representation<br />
            // </summary><br />
            // <param name="Delimiter">Optional, default "/". String to be used as delimiter of components.</param><br />
            // <returns>String representation of the rational.</returns><br />
            // <remarks></remarks><br />
            // <history><br />
            // [altair] 10.09.2003 Created<br />
            // </history><br />
<br />
            public override string ToString()<br />
            {<br />
                return ToString("/");<br />
            }<br />
<br />
            public string ToString(string Delimiter)<br />
            {<br />
                return Numerator + "/" + Denominator;<br />
            }<br />
<br />
            // <summary><br />
            // Converts rational to double precision real number<br />
            // </summary><br />
            // <returns>The rational as double precision real number.</returns><br />
            // <remarks></remarks><br />
            // <history><br />
            // [altair] 10.09.2003 Created<br />
            // </history><br />
<br />
            public double ToDouble()<br />
            {<br />
                return (double)Numerator / Denominator;<br />
            }<br />
        }<br />
<br />
        #endregion<br />
<br />
        // <summary><br />
        // Initializes new instance of this class.<br />
        // </summary><br />
        // <param name="Bitmap">Bitmap to read exif information from</param><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public ExifManager(System.Drawing.Bitmap Bitmap)<br />
        {<br />
            if (Bitmap == null)<br />
                throw new ArgumentNullException("Bitmap");<br />
            this._Image = Bitmap;<br />
        }<br />
<br />
        // <summary><br />
        // Initializes new instance of this class.<br />
        // </summary><br />
        // <param name="FileName">Name of file to be loaded</param><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 13.06.2004 Created<br />
        // </history><br />
        public ExifManager(string FileName)<br />
        {<br />
            this._Image = (System.Drawing.Bitmap)System.Drawing.Bitmap.FromFile(FileName);<br />
        }<br />
<br />
        // <summary><br />
        // Get or set encoding used for string metadata<br />
        // </summary><br />
        // <value>Encoding used for string metadata</value><br />
        // <remarks>Default encoding is UTF-8</remarks><br />
        // <history><br />
        // [altair] 11.07.2004 Created<br />
        // [altair] 05.09.2005 Changed from shared to instance member<br />
        // </history><br />
        public System.Text.Encoding Encoding<br />
        {<br />
            get<br />
            {<br />
                return this._Encoding;<br />
            }<br />
            set<br />
            {<br />
                if (value == null)<br />
                    throw new ArgumentNullException();<br />
                this._Encoding = value;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Returns copy of bitmap this instance is working on<br />
        // </summary><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 13.06.2004 Created<br />
        // </history><br />
        public System.Drawing.Bitmap GetBitmap()<br />
        {<br />
            return (System.Drawing.Bitmap)this._Image.Clone();<br />
        }<br />
<br />
        // <summary><br />
        // Returns all available data in formatted string form<br />
        // </summary><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public override string ToString()<br />
        {<br />
            System.Text.StringBuilder SB = new StringBuilder();<br />
<br />
            SB.Append("Image:");<br />
            SB.Append("\n\tDimensions:        " + this.Width + " x " + this.Height + " px");<br />
            SB.Append("\n\tResolution:        " + this.ResolutionX + " x " + this.ResolutionY + " dpi");<br />
            SB.Append("\n\tOrientation:       " + Enum.GetName(typeof(Orientations), this.Orientation));<br />
            SB.Append("\n\tTitle:             " + this.Title);<br />
            SB.Append("\n\tDescription:       " + this.Description);<br />
            SB.Append("\n\tCopyright:         " + this.Copyright);<br />
            SB.Append("\nEquipment:");<br />
            SB.Append("\n\tMaker:             " + this.EquipmentMaker);<br />
            SB.Append("\n\tModel:             " + this.EquipmentModel);<br />
            SB.Append("\n\tSoftware:          " + this.Software);<br />
            SB.Append("\nDate and time:");<br />
            SB.Append("\n\tGeneral:           " + this.DateTimeLastModified.ToString());<br />
            SB.Append("\n\tOriginal:          " + this.DateTimeOriginal.ToString());<br />
            SB.Append("\n\tDigitized:         " + this.DateTimeDigitized.ToString());<br />
            SB.Append("\nShooting conditions:");<br />
            SB.Append("\n\tExposure time:     " + this.ExposureTime.ToString("N4") + " s");<br />
            SB.Append("\n\tExposure program:  " + Enum.GetName(typeof(ExposurePrograms), this.ExposureProgram));<br />
            SB.Append("\n\tExposure mode:     " + Enum.GetName(typeof(ExposureMeteringModes), this.ExposureMeteringMode));<br />
            SB.Append("\n\tAperture:          F" + this.Aperture.ToString("N2"));<br />
            SB.Append("\n\tISO sensitivity:   " + this.ISO);<br />
            SB.Append("\n\tSubject distance:  " + this.SubjectDistance.ToString("N2") + " m");<br />
            SB.Append("\n\tFocal length:      " + this.FocalLength);<br />
            SB.Append("\n\tFlash:             " + Enum.GetName(typeof(FlashModes), this.FlashMode));<br />
            SB.Append("\n\tLight source (WB): " + Enum.GetName(typeof(LightSources), this.LightSource));<br />
            //SB.Replace("\n", vbCrLf);<br />
            //SB.Replace("\t", vbTab);<br />
            return SB.ToString();<br />
        }<br />
<br />
        #region Nicely formatted well-known properties<br />
<br />
        // <summary><br />
        // Brand of equipment (EXIF EquipMake)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string EquipmentMaker<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.EquipMake);<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Model of equipment (EXIF EquipModel)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string EquipmentModel<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.EquipModel);<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Software used for processing (EXIF Software)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string Software<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.SoftwareUsed);<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Orientation of image (position of row 0, column 0) (EXIF Orientation)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public Orientations Orientation<br />
        {<br />
            get<br />
            {<br />
                Int32 X = this.GetPropertyInt16((int)TagNames.Orientation);<br />
<br />
                if (!Enum.IsDefined(typeof(Orientations), X))<br />
                    return Orientations.TopLeft;<br />
                else<br />
                    return (Orientations)Enum.Parse(typeof(Orientations), Enum.GetName(typeof(Orientations), X));<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Time when image was last modified (EXIF DateTime).<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public DateTime DateTimeLastModified<br />
        {<br />
            get<br />
            {<br />
                try<br />
                {<br />
                    return DateTime.ParseExact(this.GetPropertyString((int)TagNames.DateTime), @"yyyy\:MM\:dd HH\:mm\:ss", null);<br />
                }<br />
                catch<br />
                {<br />
                    return DateTime.MinValue;<br />
                }<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.DateTime, value.ToString(@"yyyy\:MM\:dd HH\:mm\:ss"));<br />
                }<br />
                catch<br />
                { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Time when image was taken (EXIF DateTimeOriginal).<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public DateTime DateTimeOriginal<br />
        {<br />
            get<br />
            {<br />
                try<br />
                {<br />
                    return DateTime.ParseExact(this.GetPropertyString((int)TagNames.ExifDTOrig), @"yyyy\:MM\:dd HH\:mm\:ss", null);<br />
                }<br />
                catch<br />
                {<br />
                    return DateTime.MinValue;<br />
                }<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.ExifDTOrig, value.ToString(@"yyyy\:MM\:dd HH\:mm\:ss"));<br />
                }<br />
                catch<br />
                { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Time when image was digitized (EXIF DateTimeDigitized).<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public DateTime DateTimeDigitized<br />
        {<br />
            get<br />
            {<br />
                try<br />
                {<br />
                    return DateTime.ParseExact(this.GetPropertyString((int)TagNames.ExifDTDigitized), @"yyyy\:MM\:dd HH\:mm\:ss", null);<br />
                }<br />
                catch<br />
                {<br />
                    return DateTime.MinValue;<br />
                }<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.ExifDTDigitized, value.ToString(@"yyyy\:MM\:dd HH\:mm\:ss"));<br />
                }<br />
                catch<br />
                { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Image width<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 04.09.2005 Changed output to Int32, load from image instead of EXIF<br />
        // </history><br />
        public Int32 Width<br />
        {<br />
            get { return this._Image.Width; }<br />
        }<br />
<br />
        // <summary><br />
        // Image height<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 04.09.2005 Changed output to Int32, load from image instead of EXIF<br />
        // </history><br />
        public Int32 Height<br />
        {<br />
            get { return this._Image.Height; }<br />
        }<br />
<br />
        // <summary><br />
        // X resolution in dpi (EXIF XResolution/ResolutionUnit)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double ResolutionX<br />
        {<br />
            get<br />
            {<br />
                double R = this.GetPropertyRational((int)TagNames.XResolution).ToDouble();<br />
<br />
                if (this.GetPropertyInt16((int)TagNames.ResolutionUnit) == 3)<br />
                {<br />
                    // -- resolution is in points/cm<br />
                    return R * 2.54;<br />
                }<br />
                else<br />
                {<br />
                    // -- resolution is in points/inch<br />
                    return R;<br />
                }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Y resolution in dpi (EXIF YResolution/ResolutionUnit)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double ResolutionY<br />
        {<br />
            get<br />
            {<br />
                double R = this.GetPropertyRational((int)TagNames.YResolution).ToDouble();<br />
<br />
                if (this.GetPropertyInt16((int)TagNames.ResolutionUnit) == 3)<br />
                {<br />
                    // -- resolution is in points/cm<br />
                    return R * 2.54;<br />
                }<br />
                else<br />
                {<br />
                    // -- resolution is in points/inch<br />
                    return R;<br />
                }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Image title (EXIF ImageTitle)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string Title<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.ImageTitle);<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.ImageTitle, value);<br />
                }<br />
                catch { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // User comment (EXIF UserComment)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 13.06.2004 Created<br />
        // </history><br />
        public string UserComment<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.ExifUserComment);<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.ExifUserComment, value);<br />
                }<br />
                catch { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Artist name (EXIF Artist)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 13.06.2004 Created<br />
        // </history><br />
        public string Artist<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.Artist);<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.Artist, value);<br />
                }<br />
                catch { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Image description (EXIF ImageDescription)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string Description<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.ImageDescription);<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.ImageDescription, value);<br />
                }<br />
                catch { }<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Image copyright (EXIF Copyright)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string Copyright<br />
        {<br />
            get<br />
            {<br />
                return this.GetPropertyString((int)TagNames.Copyright);<br />
            }<br />
            set<br />
            {<br />
                try<br />
                {<br />
                    this.SetPropertyString((int)TagNames.Copyright, value);<br />
                }<br />
                catch { }<br />
            }<br />
        }<br />
<br />
<br />
        // <summary><br />
        // Exposure time in seconds (EXIF ExifExposureTime/ExifShutterSpeed)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double ExposureTimeAbs<br />
        {<br />
            get<br />
            {<br />
                if (this.IsPropertyDefined((int)TagNames.ExifExposureTime))<br />
                    // -- Exposure time is explicitly specified<br />
                    return this.GetPropertyRational((int)TagNames.ExifExposureTime).ToDouble();<br />
                else<br />
                    if (this.IsPropertyDefined((int)TagNames.ExifShutterSpeed))<br />
                        //'-- Compute exposure time from shutter spee <br />
                        return (1 / Math.Pow(2, this.GetPropertyRational((int)TagNames.ExifShutterSpeed).ToDouble()));<br />
                    else<br />
                        // -- Can't figure out <br />
                        return 0;<br />
            }<br />
        }<br />
<br />
        public Rational ExposureTime<br />
        {<br />
            get<br />
            {<br />
                if (this.IsPropertyDefined((int)TagNames.ExifExposureTime))<br />
                    // -- Exposure time is explicitly specified<br />
                    return this.GetPropertyRational((int)TagNames.ExifExposureTime);<br />
                else<br />
                    return new Rational();<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Aperture value as F number (EXIF ExifFNumber/ExifApertureValue)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double Aperture<br />
        {<br />
            get<br />
            {<br />
                if (this.IsPropertyDefined((int)TagNames.ExifFNumber))<br />
                    return this.GetPropertyRational((int)TagNames.ExifFNumber).ToDouble();<br />
                else<br />
                    if (this.IsPropertyDefined((int)TagNames.ExifAperture))<br />
                        return Math.Pow(System.Math.Sqrt(2), this.GetPropertyRational((int)TagNames.ExifAperture).ToDouble());<br />
                    else<br />
                        return 0;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Exposure program used (EXIF ExifExposureProg)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks>If not specified, returns Normal (2)</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public ExposurePrograms ExposureProgram<br />
        {<br />
            get<br />
            {<br />
                Int32 X = this.GetPropertyInt16((int)TagNames.ExifExposureProg);<br />
<br />
                if (Enum.IsDefined(typeof(ExposurePrograms), X))<br />
                    return (ExposurePrograms)Enum.Parse(typeof(ExposurePrograms), Enum.GetName(typeof(ExposurePrograms), X));<br />
                else<br />
                    return ExposurePrograms.Normal;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // ISO sensitivity<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public Int16 ISO<br />
        {<br />
            get { return this.GetPropertyInt16((int)TagNames.ExifISOSpeed); }<br />
        }<br />
<br />
        // <summary><br />
        // Subject distance in meters (EXIF SubjectDistance)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double SubjectDistance<br />
        {<br />
            get { return this.GetPropertyRational((int)TagNames.ExifSubjectDist).ToDouble(); }<br />
        }<br />
<br />
        // <summary><br />
        // Exposure method metering mode used (EXIF MeteringMode)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks>If not specified, returns Unknown (0)</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public ExposureMeteringModes ExposureMeteringMode<br />
        {<br />
            get<br />
            {<br />
                Int32 X = this.GetPropertyInt16((int)TagNames.ExifMeteringMode);<br />
<br />
                if (Enum.IsDefined(typeof(ExposureMeteringModes), X))<br />
                    return (ExposureMeteringModes)Enum.Parse(typeof(ExposureMeteringModes), Enum.GetName(typeof(ExposureMeteringModes), X));<br />
                else<br />
                    return ExposureMeteringModes.Unknown;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Focal length of lenses in mm (EXIF FocalLength)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public double FocalLength<br />
        {<br />
            get { return this.GetPropertyRational((int)TagNames.ExifFocalLength).ToDouble(); }<br />
        }<br />
<br />
        // <summary><br />
        // Flash mode (EXIF Flash)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks>If not present, value NotFired (0) is returned</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public FlashModes FlashMode<br />
        {<br />
            get<br />
            {<br />
                Int32 X = this.GetPropertyInt16((int)TagNames.ExifFlash);<br />
<br />
                if (Enum.IsDefined(typeof(FlashModes), X))<br />
                    return (FlashModes)Enum.Parse(typeof(FlashModes), Enum.GetName(typeof(FlashModes), X));<br />
                else<br />
                    return FlashModes.NotFired;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Light source / white balance (EXIF LightSource)<br />
        // </summary><br />
        // <value></value><br />
        // <remarks>If not specified, returns Unknown (0).</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public LightSources LightSource<br />
        {<br />
            get<br />
            {<br />
                Int32 X = this.GetPropertyInt16((int)TagNames.ExifLightSource);<br />
<br />
                if (Enum.IsDefined(typeof(LightSources), X))<br />
                    return (LightSources)Enum.Parse(typeof(LightSources), Enum.GetName(typeof(LightSources), X));<br />
                else<br />
                    return LightSources.Unknown;<br />
            }<br />
        }<br />
<br />
        #endregion<br />
<br />
        #region Support methods for working with EXIF properties<br />
<br />
        // <summary><br />
        // Checks if current image has specified certain property<br />
        // </summary><br />
        // <param name="PropertyID"></param><br />
        // <returns>True if image has specified property, False otherwise.</returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public bool IsPropertyDefined(Int32 PID)<br />
        {<br />
            return (Array.IndexOf(this._Image.PropertyIdList, PID) > -1);<br />
        }<br />
<br />
        // <summary><br />
        // Gets specified Int32 property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="DefaultValue">Optional, default 0. Default value returned if property is not present.</param><br />
        // <remarks>Value of property or DefaultValue if property is not present.</remarks><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public Int32 GetPropertyInt32(Int32 PID)<br />
        {<br />
            return GetPropertyInt32(PID, 0);<br />
        }<br />
<br />
        public Int32 GetPropertyInt32(Int32 PID, Int32 DefaultValue)<br />
        {<br />
            if (IsPropertyDefined(PID))<br />
                return GetInt32(this._Image.GetPropertyItem(PID).Value);<br />
            else<br />
                return DefaultValue;<br />
        }<br />
<br />
        // <summary><br />
        // Gets specified Int16 property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="DefaultValue">Optional, default 0. Default value returned if property is not present.</param><br />
        // <remarks>Value of property or DefaultValue if property is not present.</remarks><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public Int16 GetPropertyInt16(Int32 PID)<br />
        {<br />
            return GetPropertyInt16(PID, 0);<br />
        }<br />
<br />
        public Int16 GetPropertyInt16(Int32 PID, Int16 DefaultValue)<br />
        {<br />
            if (IsPropertyDefined(PID))<br />
                return GetInt16(this._Image.GetPropertyItem(PID).Value);<br />
            else<br />
                return DefaultValue;<br />
        }<br />
<br />
        // <summary><br />
        // Gets specified string property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="DefaultValue">Optional, default String.Empty. Default value returned if property is not present.</param><br />
        // <returns></returns><br />
        // <remarks>Value of property or DefaultValue if property is not present.</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public string GetPropertyString(Int32 PID)<br />
        {<br />
            return GetPropertyString(PID, "");<br />
        }<br />
<br />
        public string GetPropertyString(Int32 PID, string DefaultValue)<br />
        {<br />
            if (IsPropertyDefined(PID))<br />
                return GetString(this._Image.GetPropertyItem(PID).Value);<br />
            else<br />
                return DefaultValue;<br />
        }<br />
<br />
        // <summary><br />
        // Gets specified property in raw form<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="DefaultValue">Optional, default Nothing. Default value returned if property is not present.</param><br />
        // <returns></returns><br />
        // <remarks>Is recommended to use typed methods (like <see cref="GetPropertyString" /> etc.) instead, when possible.</remarks><br />
        // <history><br />
        // [altair] 05.09.2005 Created<br />
        // </history><br />
        public byte[] GetProperty(Int32 PID, byte[] DefaultValue)<br />
        {<br />
            if (IsPropertyDefined(PID))<br />
                return this._Image.GetPropertyItem(PID).Value;<br />
            else<br />
                return DefaultValue;<br />
        }<br />
<br />
        public byte[] GetProperty(Int32 PID)<br />
        {<br />
            return GetProperty(PID, null);<br />
        }<br />
<br />
        // <summary><br />
        // Gets specified rational property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <returns></returns><br />
        // <remarks>Value of property or 0/1 if not present.</remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public Rational GetPropertyRational(Int32 PID)<br />
        {<br />
            if (IsPropertyDefined(PID))<br />
                return GetRational(this._Image.GetPropertyItem(PID).Value);<br />
            else<br />
            {<br />
                Rational R;<br />
                R.Numerator = 0;<br />
                R.Denominator = 1;<br />
                return R;<br />
            }<br />
        }<br />
<br />
        // <summary><br />
        // Sets specified string property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="Value">Value to be set</param><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 12.6.2004 Created<br />
        // </history><br />
        public void SetPropertyString(Int32 PID, string Value)<br />
        {<br />
            byte[] Data = this._Encoding.GetBytes(Value + '\0');<br />
            SetProperty(PID, Data, ExifDataTypes.AsciiString);<br />
        }<br />
<br />
        // <summary><br />
        // Sets specified Int16 property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="Value">Value to be set</param><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 12.6.2004 Created<br />
        // </history><br />
        public void SetPropertyInt16(Int32 PID, Int16 Value)<br />
        {<br />
            byte[] Data = new byte[2];<br />
            Data[0] = (byte)(Value & 0xFF);<br />
            Data[1] = (byte)((Value & 0xFF00) >> 8);<br />
            SetProperty(PID, Data, ExifDataTypes.SignedShort);<br />
        }<br />
<br />
        // <summary><br />
        // Sets specified Int32 property<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="Value">Value to be set</param><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 13.06.2004 Created<br />
        // </history><br />
        public void SetPropertyInt32(Int32 PID, Int32 Value)<br />
        {<br />
            byte[] Data = new byte[4];<br />
            for (int I = 0; I < 4; I++)<br />
            {<br />
                Data[I] = (byte)(Value & 0xFF);<br />
                Value >>= 8;<br />
            }<br />
            SetProperty(PID, Data, ExifDataTypes.SignedLong);<br />
        }<br />
<br />
        // <summary><br />
        // Sets specified property in raw form<br />
        // </summary><br />
        // <param name="PID">Property ID</param><br />
        // <param name="Data">Raw data</param><br />
        // <param name="Type">EXIF data type</param><br />
        // <remarks>Is recommended to use typed methods (like <see cref="SetPropertyString" /> etc.) instead, when possible.</remarks><br />
        // <history><br />
        // [altair] 12.6.2004 Created<br />
        // </history><br />
        public void SetProperty(Int32 PID, byte[] Data, ExifDataTypes Type)<br />
        {<br />
            System.Drawing.Imaging.PropertyItem P = this._Image.PropertyItems[0];<br />
            P.Id = PID;<br />
            P.Value = Data;<br />
            P.Type = (Int16)Type;<br />
            P.Len = Data.Length;<br />
            this._Image.SetPropertyItem(P);<br />
        }<br />
<br />
        // <summary><br />
        // Reads Int32 from EXIF bytearray.<br />
        // </summary><br />
        // <param name="B">EXIF bytearray to process</param><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 05.09.2005 Changed from public shared to private instance method<br />
        // </history><br />
        private Int32 GetInt32(byte[] B)<br />
        {<br />
            if (B.Length < 4)<br />
                throw new ArgumentException("Data too short (4 bytes expected)", "B");<br />
<br />
            return B[3] << 24 | B[2] << 16 | B[1] << 8 | B[0];<br />
        }<br />
<br />
        // <summary><br />
        // Reads Int16 from EXIF bytearray.<br />
        // </summary><br />
        // <param name="B">EXIF bytearray to process</param><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 05.09.2005 Changed from public shared to private instance method<br />
        // </history><br />
        private Int16 GetInt16(byte[] B)<br />
        {<br />
            if (B.Length < 2)<br />
                throw new ArgumentException("Data too short (2 bytes expected)", "B");<br />
<br />
            return (short)(B[1] << 8 | B[0]);<br />
        }<br />
<br />
        // <summary><br />
        // Reads string from EXIF bytearray.<br />
        // </summary><br />
        // <param name="B">EXIF bytearray to process</param><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 05.09.2005 Changed from public shared to private instance method<br />
        // </history><br />
        private string GetString(byte[] B)<br />
        {<br />
            string R = this._Encoding.GetString(B);<br />
            if (R.EndsWith("\0"))<br />
                R = R.Substring(0, R.Length - 1);<br />
            return R;<br />
        }<br />
<br />
        // <summary><br />
        // Reads rational from EXIF bytearray.<br />
        // </summary><br />
        // <param name="B">EXIF bytearray to process</param><br />
        // <returns></returns><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // [altair] 05.09.2005 Changed from public shared to private instance method<br />
        // </history><br />
        private Rational GetRational(byte[] B)<br />
        {<br />
            Rational R = new Rational();<br />
            byte[] N = new byte[4];<br />
            byte[] D = new byte[4];<br />
            Array.Copy(B, 0, N, 0, 4);<br />
            Array.Copy(B, 4, D, 0, 4);<br />
            R.Denominator = this.GetInt32(D);<br />
            R.Numerator = this.GetInt32(N);<br />
            return R;<br />
        }<br />
<br />
        #endregion<br />
<br />
        #region " IDisposable implementation "<br />
<br />
        // <summary><br />
        // Disposes unmanaged resources of this class<br />
        // </summary><br />
        // <remarks></remarks><br />
        // <history><br />
        // [altair] 10.09.2003 Created<br />
        // </history><br />
        public void Dispose()<br />
        {<br />
            this._Image.Dispose();<br />
        }<br />
<br />
        #endregion<br />
<br />
    }<br />
<br />
}<br />
<br />

Generalhelp please with display code Pin
markoliverreally21-Oct-06 11:32
markoliverreally21-Oct-06 11:32 
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.