Skip to content

Conversation

NafeelaNazhir
Copy link
Contributor

@NafeelaNazhir NafeelaNazhir commented Sep 18, 2025

Description of Change

This PR reopens the work from the closed #30484

This pull request introduces two new test cases to address image processing issues in MAUI versions 9.0.80 and 9.0.81. It includes XAML and C# implementations for the test pages, along with automated UI tests to verify the behavior. The changes focus on testing the IImage.Downsize() functionality and its handling of image flipping, rotation, and exceptions when invoked from a background thread.

New Test Pages for Image Processing Issues:

Issue30350.xaml and Issue30350.xaml.cs: Added a test page to reproduce and analyze the issue where IImage.Downsize() causes flipped or rotated images on iOS in MAUI 9.0.80+. The page displays the original and downsized images, along with their dimensions, and updates the status dynamically. [1] [2]

Issue30426.xaml and Issue30426.xaml.cs: Added a test page to reproduce and analyze the issue where IImage.Downsize() throws an exception when called from a background thread on iOS in MAUI 9.0.81. The page includes controls to load an image, adjust the resize percentage, and process the image, with error handling and status updates. [1] [2]

Automated UI Tests:

Issue30350.cs: Added a UI test to verify that the downsized image appears correctly without flipping or rotation issues. It checks for the presence of the test control and validates the screenshot.

Issue30426.cs: Added a UI test to ensure that loading and processing an image using IImage.Downsize() does not throw exceptions and completes successfully. The test validates status messages and button interactions.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Sep 18, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review September 18, 2025 07:36
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 07:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive test coverage for two critical image processing bugs in .NET MAUI versions 9.0.80 and 9.0.81. The changes add test pages and automated UI tests to validate IImage.Downsize() functionality and identify issues with image orientation and background thread exceptions on iOS.

  • Adds test infrastructure for reproducing image flipping/rotation issues in IImage.Downsize() on iOS 9.0.80+
  • Implements test coverage for background thread exceptions when calling IImage.Downsize() on iOS 9.0.81
  • Creates automated UI tests to validate both scenarios with proper error handling and status verification

Reviewed Changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Issue30350.xaml XAML page displaying original and downsized images side-by-side to visualize rotation/flipping issues
Issue30350.xaml.cs Code-behind implementing image loading, downsizing logic, and property binding for visual comparison
Issue30350.cs UI test validating image downsize display functionality through screenshot verification
Issue30426.xaml XAML page with controls for loading images, adjusting resize parameters, and processing on background threads
Issue30426.xaml.cs Code-behind implementing background thread image processing to reproduce threading exceptions
Issue30426.cs UI test verifying successful image loading and processing without exceptions through status message validation

namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 30350, "IImage downsize broken starting from 9.0.80 and not fixed in 9.0.81", PlatformAffected.iOS)]
public partial class Issue30350 : TestContentPage
Copy link
Preview

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class does not properly implement INotifyPropertyChanged interface. While it uses OnPropertyChanged() calls, the class should explicitly implement INotifyPropertyChanged and include the event declaration for proper data binding functionality.

Copilot generated this review using guidance from repository custom instructions.

get => _originalSource;
set
{
if (Equals(value, _originalSource))
Copy link
Preview

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Equals() on ImageSource objects may not work as expected since ImageSource doesn't override Equals(). Consider using ReferenceEquals() or implement a custom comparison method.

Copilot uses AI. Check for mistakes.

get => _downsizedSource;
set
{
if (Equals(value, _downsizedSource))
Copy link
Preview

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Equals() on ImageSource objects may not work as expected since ImageSource doesn't override Equals(). Consider using ReferenceEquals() or implement a custom comparison method.

Suggested change
if (Equals(value, _downsizedSource))
if (ReferenceEquals(value, _downsizedSource))

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration testing-missing-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants