From 7f37468cbb5f87279ab8c3909bb73f3fb5de5fad Mon Sep 17 00:00:00 2001 From: Sergey Minakov Date: Wed, 17 Jan 2018 22:04:53 +0300 Subject: [PATCH] added autoorient feature --- Sources/MagickWand/Wand/ImageWand/ImageWand+Resize.swift | 4 ++++ Tests/MagickWandTests/ImageWandTests.swift | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/MagickWand/Wand/ImageWand/ImageWand+Resize.swift b/Sources/MagickWand/Wand/ImageWand/ImageWand+Resize.swift index 1f8ebd5..4ca7eb1 100644 --- a/Sources/MagickWand/Wand/ImageWand/ImageWand+Resize.swift +++ b/Sources/MagickWand/Wand/ImageWand/ImageWand+Resize.swift @@ -26,6 +26,10 @@ import CMagickWand extension ImageWand { + public func autoOrient() -> Bool { + return MagickAutoOrientImage(self.pointer).bool + } + // https://www.imagemagick.org/api/magick-image.php // TODO: Resize modes. like AspectFill, AspectFit. // TODO: resized, rescaled -> ImageWand diff --git a/Tests/MagickWandTests/ImageWandTests.swift b/Tests/MagickWandTests/ImageWandTests.swift index ff749dc..796d47e 100644 --- a/Tests/MagickWandTests/ImageWandTests.swift +++ b/Tests/MagickWandTests/ImageWandTests.swift @@ -114,7 +114,7 @@ class ImageWandTests: XCTestCase { private let variants: [(name: String, type: String)] = [ ("PNG", "png"), ("JPEG", "jpeg"), - ("PDF", "pdf"), //FIXME: does not work on linux + ("PDF", "pdf"), ("GIF", "gif"), //("SVG", "svg"), //FIXME: cannot create or read ("TIFF", "tiff"),