示例#1
0
        /// <summary>
        ///    Attempts to extract the media properties of the main
        ///    photo.
        /// </summary>
        /// <returns>
        ///    A <see cref="Properties" /> object with a best effort guess
        ///    at the right values. When no guess at all can be made,
        ///    <see langword="null" /> is returned.
        /// </returns>
        private Properties ExtractProperties()
        {
            int width = 0, height = 0;

            IFDTag       tag       = GetTag(TagTypes.TiffIFD) as IFDTag;
            IFDStructure structure = tag.Structure;

            width  = (int)(structure.GetLongValue(0, 0x07) ?? 0);
            height = (int)(structure.GetLongValue(0, 0x06) ?? 0);

            var vendor = ImageTag.Make;

            if (vendor == "LEICA")
            {
                vendor = "Leica";
            }
            var desc = String.Format("{0} RAW File", vendor);

            if (width > 0 && height > 0)
            {
                return(new Properties(TimeSpan.Zero, new Codec(width, height, desc)));
            }

            return(null);
        }
示例#2
0
        protected virtual Properties ExtractProperties()
        {
            int    width = 0, height = 0;
            IFDTag tag = GetTag(TagTypes.TiffIFD)
                         as IFDTag;
            IFDStructure structure = tag.Structure;

            width  = (int)(structure.GetLongValue(0, (ushort)IFDEntryTag.ImageWidth) ?? 0);
            height = (int)(structure.GetLongValue(0, (ushort)IFDEntryTag.ImageLength) ?? 0);
            if (width > 0 && height > 0)
            {
                return(new Properties(TimeSpan.Zero, CreateCodec(width, height)));
            }
            return(null);
        }