Exemplo n.º 1
0
        /// <summary>
        /// Creates a new ExifFile from the given JPEG/Exif image file.
        /// </summary>
        /// <param name="filename">Path to the JPEJ/Exif image file.</param>
        /// <returns>An ExifFile class initialized from the specified JPEG/Exif image file.</returns>
        public static ExifFile Read(string filename)
        {
            ExifFile exif = new ExifFile();

            // Read the JPEG file and process the APP1 section
            exif.Properties = new Dictionary <ExifTag, ExifProperty>();
            exif.file       = new JPEGFile(filename);
            exif.ReadAPP1();

            // Process the maker note
            exif.makerNoteProcessed = false;

            return(exif);
        }
Exemplo n.º 2
0
        public static ExifFile Read(Stream fileStream)
        {
            ExifFile exif = new ExifFile();

            // Read the JPEG file and process the APP1 section
            exif.Properties = new Dictionary <ExifTag, ExifProperty>();
            exif.file       = new JPEGFile();
            if (!exif.file.Read(fileStream))
            {
                exif.file = null;
                exif      = null;
                return(null);
            }
            exif.ReadAPP1();

            // Process the maker note
            exif.makerNoteProcessed = false;

            return(exif);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new ExifFile from the given JPEG/Exif image file.
        /// </summary>
        /// <param name="filename">Path to the JPEJ/Exif image file.</param>
        /// <returns>An ExifFile class initialized from the specified JPEG/Exif image file.</returns>
        public static ExifFile Read(string filename)
        {
            ExifFile exif = new ExifFile();

            // Read the JPEG file and process the APP1 section
            exif.Properties = new Dictionary<ExifTag, ExifProperty>();
            exif.file = new JPEGFile(filename);
            exif.ReadAPP1();

            // Process the maker note
            exif.makerNoteProcessed = false;

            return exif;
        }
Exemplo n.º 4
0
		public static ExifFile Read(Stream fileStream)
        {
            ExifFile exif = new ExifFile();

            // Read the JPEG file and process the APP1 section
            exif.Properties = new Dictionary<ExifTag, ExifProperty>();
            exif.file = new JPEGFile();
			if(!exif.file.Read(fileStream))
			{
				exif.file = null;
				exif = null;
				return null;
			}
            exif.ReadAPP1();

            // Process the maker note
            exif.makerNoteProcessed = false;

            return exif;
        }
Exemplo n.º 5
0
        /// <summary>
        /// JPEG/Exif image file을 이용해서 새로운 ExifFile객체를 생성합니다.
        /// </summary>
        /// <param name="buffer">JPEG/Exif 파일의 데이터가 들어있는 배열입니다.</param>
        /// <returns>JPEG/Exif 데이터로 초기화된 ExifFile 클래스입니다.</returns>
        public static ExifFile Read(byte[] buffer)
        {
            ExifFile exif = new ExifFile();

            // Read the JPEG file and process the APP1 section
            exif.Properties = new Dictionary<ExifTag, ExifProperty>();

            using (var stream = new MemoryStream(buffer))
                exif.file = new JPEGFile(stream);

            exif.ReadAPP1();

            // Process the maker note
            exif.makerNoteProcessed = false;
            return exif;
        }