Example #1
0
        protected virtual void ParseIfdBlock(IfdBlock block, BinaryReader reader)
        {
            switch (block.tag)
            {
            case IfdTag.ImageWidth:
                ImageWidth    = block.GetUInt16();
                block.variant = ImageWidth;
                break;

            case IfdTag.ImageLength:
                ImageHeight   = block.GetUInt16();
                block.variant = ImageHeight;
                break;

            case IfdTag.Make:
                Maker         = block.GetString();
                block.variant = Maker;
                break;

            case IfdTag.Model:
                Model         = block.GetString();
                block.variant = Model;
                break;

            case IfdTag.StripOffsets:
                StripOffset   = (int)block.GetUInt32();
                block.variant = StripOffset;
                break;

            case IfdTag.Orientation:
                Orientation   = (int)block.GetUInt32();
                block.variant = Orientation;
                break;

            case IfdTag.RowsPerStrip:
                StripByteCounts = (int)block.GetUInt32();
                block.variant   = StripByteCounts;
                break;

            case IfdTag.ExifIFD:
                reader.BaseStream.Seek(block.GetUInt32(), SeekOrigin.Begin);
                ParseIfd(reader);
                break;

            case IfdTag.ExposureTime:
                Shutter       = block.GetFraction();
                block.variant = Shutter.ToFloat();
                break;

            case IfdTag.FNumber:
                Aperture      = block.GetFraction();
                block.variant = Aperture.ToFloat();
                break;

            case IfdTag.ExposureProgram:
                ExposureProgram = (int)block.GetUInt32();
                block.variant   = ExposureProgram;
                break;

            case IfdTag.ExifVersion:
                ExifVersion   = block.GetString();
                block.variant = ExifVersion;
                break;

            case IfdTag.DateTimeOriginal:
                DateTimeOriginal = block.GetString();
                block.variant    = DateTimeOriginal;
                break;

            case IfdTag.DateTimeDigitized:
                DateTimeDigitized = block.GetString();
                block.variant     = DateTimeDigitized;
                break;

            case IfdTag.ExposureBiasValue:
                ExposureBiasValue = block.GetFraction();
                block.variant     = ExposureBiasValue.ToFloat();
                break;

            case IfdTag.MaxApertureValue:
                MaxApertureValue = block.GetFraction();
                block.variant    = MaxApertureValue.ToFloat();
                break;

            case IfdTag.MeteringMode:
                MeteringMode  = (int)block.GetUInt32();
                block.variant = MeteringMode;
                break;

            case IfdTag.Flash:
                Flash         = (int)block.GetUInt32();
                block.variant = Flash;
                break;

            case IfdTag.FocalLength:
                FocalLength   = block.GetFraction();
                block.variant = FocalLength.ToFloat();
                break;

            case IfdTag.SubsecTimeOriginal:
                SubsecTimeOriginal = block.GetString();
                block.variant      = SubsecTimeOriginal;
                break;

            case IfdTag.SubsecTimeDigitized:
                SubsecTimeDigitized = block.GetString();
                block.variant       = SubsecTimeDigitized;
                break;

            case IfdTag.FileSource:
                FileSource    = (int)block.GetUInt32();
                block.variant = FileSource;
                break;

            default:
                if (block.length <= 4)
                {
                    block.variant = block.GetUInt32();
                }
                else
                {
                    block.variant = (block.type == IfdType.UInt32Fraction) ? block.GetFraction().ToString() : string.Join(", ", block.rawdata);
                }
                break;
            }
        }
Example #2
0
 protected virtual void ParseIfdBlock(IfdBlock block, BinaryReader reader)
 {
     switch (block.tag)
     {
         case IfdTag.ImageWidth:
             ImageWidth = block.GetUInt16();
             break;
         case IfdTag.ImageLength:
             ImageHeight = block.GetUInt16();
             break;
         case IfdTag.Make:
             Maker = block.GetString();
             break;
         case IfdTag.Model:
             Model = block.GetString();
             break;
         case IfdTag.StripOffsets:
             StripOffset = (int) block.GetUInt32();
             break;
         case IfdTag.Orientation:
             Orientation = (int) block.GetUInt32();
             break;
         case IfdTag.RowsPerStrip:
             StripByteCounts = (int) block.GetUInt32();
             break;
         case IfdTag.ExifIFD:
             reader.BaseStream.Seek(block.GetUInt32(), SeekOrigin.Begin);
             ParseIfd(reader);
             break;
         case IfdTag.ExposureTime:
             Shutter = block.GetFraction();
             break;
         case IfdTag.FNumber:
             Aperture = block.GetFraction();
             break;
         case IfdTag.ExposureProgram:
             ExposureProgram = (int) block.GetUInt32();
             break;
         case IfdTag.ExifVersion:
             ExifVersion = block.GetString();
             break;
         case IfdTag.DateTimeOriginal:
             DateTimeOriginal = block.GetString();
             break;
         case IfdTag.DateTimeDigitized:
             DateTimeDigitized = block.GetString();
             break;
         case IfdTag.ExposureBiasValue:
             ExposureBiasValue = block.GetFraction();
             break;
         case IfdTag.MaxApertureValue:
             MaxApertureValue = block.GetFraction();
             break;
         case IfdTag.MeteringMode:
             MeteringMode = (int) block.GetUInt32();
             break;
         case IfdTag.Flash:
             Flash = (int) block.GetUInt32();
             break;
         case IfdTag.FocalLength:
             FocalLength = block.GetFraction();
             break;
         case IfdTag.SubsecTimeOriginal:
             SubsecTimeOriginal = block.GetString();
             break;
         case IfdTag.SubsecTimeDigitized:
             SubsecTimeDigitized = block.GetString();
             break;
         case IfdTag.FileSource:
             FileSource = (int) block.GetUInt32();
             break;
     }
 }
Example #3
0
        protected virtual void ParseIfdBlock(IfdBlock block, BinaryReader reader)
        {
            switch (block.tag)
            {
            case IfdTag.ImageWidth:
                ImageWidth = block.GetUInt16();
                break;

            case IfdTag.ImageLength:
                ImageHeight = block.GetUInt16();
                break;

            case IfdTag.Make:
                Maker = block.GetString();
                break;

            case IfdTag.Model:
                Model = block.GetString();
                break;

            case IfdTag.StripOffsets:
                StripOffset = (int)block.GetUInt32();
                break;

            case IfdTag.Orientation:
                Orientation = (int)block.GetUInt32();
                break;

            case IfdTag.RowsPerStrip:
                StripByteCounts = (int)block.GetUInt32();
                break;

            case IfdTag.ExifIFD:
                reader.BaseStream.Seek(block.GetUInt32(), SeekOrigin.Begin);
                ParseIfd(reader);
                break;

            case IfdTag.ExposureTime:
                Shutter = block.GetFraction();
                break;

            case IfdTag.FNumber:
                Aperture = block.GetFraction();
                break;

            case IfdTag.ExposureProgram:
                ExposureProgram = (int)block.GetUInt32();
                break;

            case IfdTag.ExifVersion:
                ExifVersion = block.GetString();
                break;

            case IfdTag.DateTimeOriginal:
                DateTimeOriginal = block.GetString();
                break;

            case IfdTag.DateTimeDigitized:
                DateTimeDigitized = block.GetString();
                break;

            case IfdTag.ExposureBiasValue:
                ExposureBiasValue = block.GetFraction();
                break;

            case IfdTag.MaxApertureValue:
                MaxApertureValue = block.GetFraction();
                break;

            case IfdTag.MeteringMode:
                MeteringMode = (int)block.GetUInt32();
                break;

            case IfdTag.Flash:
                Flash = (int)block.GetUInt32();
                break;

            case IfdTag.FocalLength:
                FocalLength = block.GetFraction();
                break;

            case IfdTag.SubsecTimeOriginal:
                SubsecTimeOriginal = block.GetString();
                break;

            case IfdTag.SubsecTimeDigitized:
                SubsecTimeDigitized = block.GetString();
                break;

            case IfdTag.FileSource:
                FileSource = (int)block.GetUInt32();
                break;
            }
        }