示例#1
0
        public static EXIF Parse(byte[] bytes, ref int offset)
        {
            var exif = new EXIF(bytes, offset);

            offset = offset + exif.Length + 2;

            return(exif);
        }
示例#2
0
        public static APPDataType GetSectionType(byte[] bytes, int offset)
        {
            if (APP0Marker.IsType(bytes, offset))
            {
                return(APPDataType.APP0);
            }
            if (EXIF.IsType(bytes, offset))
            {
                return(APPDataType.APP1);
            }

            return(APPDataType.Undefined);
        }
示例#3
0
        public JPEGEXIFFile(byte[] bytes, int offset)
        {
            BitUtils.GetValue(ref SOI, bytes, ref offset);
            bool parse = true;

            while (parse)
            {
                switch (GetSectionType(bytes, offset))
                {
                case APPDataType.APP0: APP0 = APP0Marker.Parse(bytes, ref offset); break;

                case APPDataType.APP1: Exif = EXIF.Parse(bytes, ref offset); parse = false;  break;

                default: parse = false; break;
                }
            }
        }