public override PixbufOrientation GetOrientation() { PixbufOrientation orientation = PixbufOrientation.TopLeft; #if USE_TIFF try { DirectoryEntry e = ExifHeader.Directory.Lookup(TagId.Orientation); orientation = (PixbufOrientation)e.ValueAsLong [0]; } catch { System.Console.WriteLine("error checking orientation"); } #else Exif.ExifEntry e = this.ExifData.GetContents(Exif.Ifd.Zero).Lookup(Exif.Tag.Orientation); if (e != null) { ushort [] value = e.GetDataUShort(); orientation = (PixbufOrientation)value [0]; } #endif if (orientation < PixbufOrientation.TopLeft || orientation > PixbufOrientation.LeftBottom) { orientation = PixbufOrientation.TopLeft; } return(orientation); }
public void SetDescription(string value) { Exif.ExifContent exif_content = this.ExifData.GetContents(Exif.Ifd.Exif); Exif.ExifEntry entry = exif_content.GetEntry(Exif.Tag.UserComment); UserComment comment = new UserComment(value); byte [] data = comment.GetBytes(entry.ByteOrder == Exif.ByteOrder.Intel); entry.SetData(data); }
public void SetOrientation(PixbufOrientation orientation) { Exif.ExifEntry e = this.ExifData.GetContents(Exif.Ifd.Zero).GetEntry(Exif.Tag.Orientation); // System.Console.WriteLine ("Saving orientation as {0}", orientation); e.SetData((ushort)orientation); e = this.ExifData.GetContents(Exif.Ifd.One).Lookup(Exif.Tag.Orientation); if (e != null) { e.SetData((ushort)orientation); } }
public void SetDateTimeOriginal(DateTime time) { Exif.ExifEntry e = ExifData.LookupFirst(Exif.Tag.DateTimeOriginal); if (e != null) { e.SetData(time); } else { Exif.ExifContent exif_content = this.ExifData.GetContents(Exif.Ifd.Exif); Exif.ExifEntry entry = exif_content.GetEntry(Exif.Tag.DateTimeOriginal); entry.SetData(time); } }
public override PixbufOrientation GetOrientation() { PixbufOrientation orientation = PixbufOrientation.TopLeft; Exif.ExifEntry e = this.ExifData.GetContents(Exif.Ifd.Zero).Lookup(Exif.Tag.Orientation); if (e != null) { ushort [] value = e.GetDataUShort(); orientation = (PixbufOrientation)value [0]; } if (orientation < PixbufOrientation.TopLeft || orientation > PixbufOrientation.LeftBottom) { orientation = PixbufOrientation.TopLeft; } return(orientation); }