Skip to content

Rotating images based on the 'orientation' EXIF tag with JHEAD software.

License

Notifications You must be signed in to change notification settings

SeppPenner/AutoImageTurner

Repository files navigation

AutoImageTurner und AutoImageTurnInCSharp

Rotating images based on the 'orientation' EXIF tag with JHEAD software.

AutoImageTurnInCSharp: Kind of a 'library' for CSharp on how to rotate images based on the 'orientation' EXIF tag.

AutoImageTurner is the corresponding .exe.

See here for more information on the EXIF tags used in Windows (.Net).

For C# see also here for another possible implementation.

Example images using each of the EXIF orientation flags (1-to-8), in both landscape and portrait orientations See here.

See here for more information.

Build status GitHub issues GitHub forks GitHub stars License: MIT Known Vulnerabilities Blogger Patreon PayPal

Basic usage

using System;
using System.Windows.Forms;

namespace AutoImageTurner
{
    public class AutoTurnExample
    {
        public void Test()
        {
            try
            {
                IAutoTurnImages rotator = new AutoTurnImages();
                rotator.RotateImagesInFolder("C:\\abc", "jpg");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.StackTrace, MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
		
		public void Test()
        {
            try
            {
                IAutoTurnImages rotator = new AutoTurnImages();
                rotator.RotateImagesInFolderNoMessage("C:\\abc", "jpg");
                //Doesn't show an error message from the method itself
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.StackTrace, MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
    }
}

Screenshot from the executable

Screenshot from the executable

Copyright (of the images)

Dave Perrett :: hello@daveperrett.com :: @daveperrett

These images are licensed under the MIT License.

Copyright (c) 2010 Dave Perrett. See License for details.

Change history

See the Changelog.

About

Rotating images based on the 'orientation' EXIF tag with JHEAD software.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published