-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fluttercandies/fix-ios-orientation
Fix ios orientation
- Loading branch information
Showing
13 changed files
with
69 additions
and
53 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/// generate by resouce_generator library, shouldn't edit. | ||
class R { | ||
/// ![preview](file:///Users/cai/Documents/GitHub/flutter_image_editor/example/./assets/have-exif-8.jpg) | ||
static const String ASSETS_HAVE_EXIF_8_JPG = "assets/have-exif-8.jpg"; | ||
|
||
|
||
/// ![preview](file:///Users/cai/Documents/GitHub/flutter_image_editor/example/./assets/have-exif-3.jpg) | ||
static const String ASSETS_HAVE_EXIF_3_JPG = "assets/have-exif-3.jpg"; | ||
|
||
/// ![preview](file:///Users/cai/Documents/GitHub/flutter_image_editor/example/./assets/icon.png) | ||
static const String ASSETS_ICON_PNG = "assets/icon.png"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ struct RotateOption: FlutterImageEditorOption { | |
struct FormatOption { | ||
var format: Int | ||
var quality: Int | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// UIImage+fix_orientation.swift | ||
// image_editor | ||
// | ||
// Created by Caijinglong on 2019/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
extension UIImage { | ||
func fixOrientation() -> UIImage { | ||
if imageOrientation == .up { | ||
return self | ||
} | ||
|
||
UIGraphicsBeginImageContextWithOptions(size, false, scale) | ||
|
||
draw(in: CGRect(origin: .zero, size: size)) | ||
|
||
guard let result = UIGraphicsGetImageFromCurrentImageContext() else { | ||
UIGraphicsEndImageContext() | ||
return self | ||
} | ||
|
||
UIGraphicsEndImageContext() | ||
|
||
return result | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters