Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

When compiled with Xcode 15, images that can't be loaded by UIImage will cause the codepaths in some XCTest tests to throw exceptions. To address this:

  • Replace the test ICO file with one that UIImage is able to open.
  • Remove the SVG test, since UIImage cannot directly load SVGs.

Fixes flutter/flutter#134973

When compiled with Xcode 15, images that can't be loaded by UIImage will
cause the codepaths in some XCTest tests to throw exceptions. To address
this:
- Replace the test ICO file with one that UIImage is able to open.
- Remove the SVG test, since UIImage cannot directly load SVGs.

Fixes flutter/flutter#134973
Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

So SVGs don't work with image_picker at all? If SVGs don't work at all, we should probably file an issue to investigate supporting them / making sure we have proper error messaging.

Also, just curious, do you know what was wrong with the ICO image?

Other than that, LGTM. Thanks for fixing this!

@stuartmorgan-g
Copy link
Collaborator Author

stuartmorgan-g commented Oct 5, 2023

So SVGs don't work with image_picker at all? If SVGs don't work at all, we should probably file an issue to investigate supporting them / making sure we have proper error messaging.

I don't know if they work or not, but this test isn't actually testing them because the item provider returns nil since UIImage doesn't support SVGs directly. From some looking around, SVG support on iOS seems pretty limited, so I'm not sure how easy it would be to validate them. I figured it's obscure enough for the image_picker use case that we could leave any further investigation of SVG support to be custom-issue-report driven.

Also, just curious, do you know what was wrong with the ICO image?

Nope, I looked around a bit and couldn't figure out what the requirements are for macOS/iOS to handle an ICO. I don't think the ICO itself was invalid, I think Apple's libraries (it's not just UIImage; Finder wouldn't show a preview for it and Preview wouldn't load it) just can't handle some subset of the format.

@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Oct 5, 2023
@stuartmorgan-g
Copy link
Collaborator Author

Changelog/version override: these changes are test-only, just in a way the tooling doesn't detect.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 5, 2023
@auto-submit auto-submit bot merged commit e578a16 into flutter:main Oct 5, 2023
@guptavirendra

This comment was marked as off-topic.

@stuartmorgan-g stuartmorgan-g deleted the image-picker-xcode-15-test-fixes branch October 5, 2023 19:25
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: image_picker platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XCTests and XCUITests failing on image_picker package iOS 17 XCode RC1

3 participants