Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        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);
        }