Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Fix Issue Picture Chooser on Windows phone smash images with exif rotation #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -180,6 +180,14 @@ private async Task<IRandomAccessStream> ResizeJpegStreamAsync(int maxPixelDimens
ExifOrientationMode.RespectExifOrientation,
ColorManagementMode.DoNotColorManage);

//switch dimension on rotations
if (decoder.PixelWidth != decoder.OrientedPixelWidth)
{
var temp = targetHeight;
targetHeight = targetWidth;
targetWidth = temp;
}

var destinationStream = new InMemoryRandomAccessStream();
var bitmapPropertiesSet = new BitmapPropertySet();
bitmapPropertiesSet.Add("ImageQuality", new BitmapTypedValue(((double)percentQuality) / 100.0, PropertyType.Single));
Expand Down
Expand Up @@ -138,6 +138,14 @@ private async Task<IRandomAccessStream> ResizeJpegStreamAsync(int maxPixelDimens
ExifOrientationMode.RespectExifOrientation,
ColorManagementMode.DoNotColorManage);

//switch dimension on rotations
if (decoder.PixelWidth != decoder.OrientedPixelWidth)
{
var temp = targetHeight;
targetHeight = targetWidth;
targetWidth = temp;
}

var destinationStream = new InMemoryRandomAccessStream();
var bitmapPropertiesSet = new BitmapPropertySet();
bitmapPropertiesSet.Add("ImageQuality", new BitmapTypedValue(((double)percentQuality) / 100.0, PropertyType.Single));
Expand Down