Example #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);
        }
Example #2
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);
        }