-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[google_maps_flutter] Fix ios tile overlay not loading when dealing with wide gamut images #6377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LouiseHsu
merged 10 commits into
flutter:main
from
LouiseHsu:fix-wide-gamut-issue-google-maps
Mar 27, 2024
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2290472
remove extra proj files
LouiseHsu 72b7252
Merge branch 'main' into fix-wide-gamut-issue-google-maps
LouiseHsu c80245b
delicious formatting
LouiseHsu 372d30d
Merge branch 'fix-wide-gamut-issue-google-maps' of github.com:LouiseH…
LouiseHsu 5d95c7d
add test
LouiseHsu 54ffeef
missed asset file oopsies
LouiseHsu efb9f4d
pr updates, removed lingering RunnerUITest references
LouiseHsu 5912d94
test name
LouiseHsu d889ab9
pubspec, changelog, formatting
LouiseHsu 3a7a54e
warning
LouiseHsu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...aps_flutter_ios/example/ios12/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,10 @@ @interface FLTGoogleMapFactory (Test) | |
| @interface GoogleMapsTests : XCTestCase | ||
| @end | ||
|
|
||
| @interface FLTTileProviderController (Testing) | ||
| - (UIImage*)handleResultTile:(nullable UIImage*)tileImage; | ||
| @end | ||
|
|
||
| @implementation GoogleMapsTests | ||
|
|
||
| - (void)testPlugin { | ||
|
|
@@ -62,4 +66,20 @@ - (void)testMapsServiceSync { | |
| XCTAssertEqual(factory1.sharedMapServices, factory2.sharedMapServices); | ||
| } | ||
|
|
||
| - (void)testWideGamutImagesProperlyHandled { | ||
|
LouiseHsu marked this conversation as resolved.
Outdated
|
||
| FLTTileProviderController *controller = [[FLTTileProviderController alloc] init]; | ||
|
|
||
| UIImage *wideGamutImage = [UIImage imageWithContentsOfFile:@"assets/widegamut.png"]; | ||
|
|
||
| UIImage *downsampledImage = [controller handleResultTile:wideGamutImage]; | ||
|
|
||
| CGImageRef imageRef = downsampledImage.CGImage; | ||
| CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); | ||
| bool isFloat = (bitmapInfo && kCGBitmapFloatComponents); | ||
|
LouiseHsu marked this conversation as resolved.
Outdated
|
||
| size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef); | ||
|
|
||
| XCTAssert(isFloat == false); | ||
|
LouiseHsu marked this conversation as resolved.
Outdated
|
||
| XCTAssert(bitsPerComponent != 16); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the value actually gonna be?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non-wide gamut imgs are 8 bit, changed to test that instead |
||
| } | ||
|
|
||
| @end | ||
Binary file added
BIN
+2.95 KB
...tter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/assets/widegamut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.