/// <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); }
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); }