Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Bugfix 730: TIFFDict Meta Data Exception On iOS MediaPickerDelegate.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ccdarko committed Sep 20, 2019
1 parent 75943e5 commit 47e5cd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Media.Plugin/iOS/MediaPickerDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,11 @@ internal static bool SaveImageWithMetadata(UIImage image, float quality, NSDicti

if (meta.ContainsKey(ImageIO.CGImageProperties.TIFFDictionary))
{
var newTiffDict = meta[ImageIO.CGImageProperties.TIFFDictionary] as NSDictionary;
if (newTiffDict != null)
var existingTiffDict = meta[ImageIO.CGImageProperties.TIFFDictionary] as NSDictionary;
if (existingTiffDict != null)
{
var newTiffDict = new NSMutableDictionary();
newTiffDict.SetValuesForKeysWithDictionary(existingTiffDict);
newTiffDict.SetValueForKey(meta[ImageIO.CGImageProperties.Orientation], ImageIO.CGImageProperties.TIFFOrientation);
destinationOptions.TiffDictionary = new CGImagePropertiesTiff(newTiffDict);
}
Expand Down

0 comments on commit 47e5cd9

Please sign in to comment.