Skip to content

Commit 662d87e

Browse files
committed
Fix Windows build & minor code styling
1 parent 20e4ba1 commit 662d87e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Essentials/src/MediaPicker/ImageProcessor.ios.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#nullable enable
2-
using System;
32
using System.IO;
43
using System.Threading.Tasks;
5-
using CoreGraphics;
64
using Foundation;
7-
using ImageIO;
85
using UIKit;
96

107
namespace Microsoft.Maui.Essentials;

src/Essentials/src/MediaPicker/MediaPicker.windows.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Microsoft.Maui.Essentials;
1414
using Microsoft.Maui.Storage;
1515
using Windows.Foundation.Collections;
16-
using Windows.Graphics.Imaging;
1716
using Windows.Media.Capture;
1817
using Windows.Storage;
1918
using Windows.Storage.Pickers;
@@ -102,7 +101,7 @@ public Task<List<FileResult>> PickVideosAsync(MediaPickerOptions? options = null
102101
options?.MaximumWidth,
103102
options?.MaximumHeight,
104103
options?.CompressionQuality ?? 100,
105-
result.Name,
104+
result!.Name,
106105
options?.RotateImage ?? false);
107106

108107
if (processedStream != null)
@@ -252,7 +251,7 @@ public async Task<List<FileResult>> PickMultipleAsync(MediaPickerOptions? option
252251
var fileResult = new FileResult(file);
253252

254253
// Apply rotation if needed for photos
255-
if (photo && ImageProcessor.IsRotationNeeded(options) && file != null)
254+
if (photo && ImageProcessor.IsRotationNeeded(options) && file is not null)
256255
{
257256
try
258257
{
@@ -271,8 +270,8 @@ public async Task<List<FileResult>> PickMultipleAsync(MediaPickerOptions? option
271270
}
272271
catch (Exception ex)
273272
{
274-
System.Diagnostics.Debug.WriteLine($"Failed to rotate image: {ex.Message}");
275273
// If rotation fails, continue with the original file
274+
System.Diagnostics.Debug.WriteLine($"Failed to rotate image: {ex.Message}");
276275
}
277276
}
278277

@@ -285,10 +284,10 @@ public async Task<List<FileResult>> PickMultipleAsync(MediaPickerOptions? option
285284
options?.MaximumWidth,
286285
options?.MaximumHeight,
287286
options?.CompressionQuality ?? 100,
288-
file.Name,
287+
file!.Name,
289288
options?.RotateImage ?? false);
290289

291-
if (processedStream != null)
290+
if (processedStream is not null)
292291
{
293292
// Convert to MemoryStream for ProcessedImageFileResult
294293
var memoryStream = new MemoryStream();

0 commit comments

Comments
 (0)