Skip to content

drop image package dependency for goldens#54144

Merged
Piinks merged 18 commits intoflutter:masterfrom
jakemac53:remove-image-dep
Apr 9, 2020
Merged

drop image package dependency for goldens#54144
Piinks merged 18 commits intoflutter:masterfrom
jakemac53:remove-image-dep

Conversation

@jakemac53
Copy link
Copy Markdown
Contributor

@jakemac53 jakemac53 commented Apr 6, 2020

Description

Fixes #39152.

Uses the Image object from dart:ui to endcode/decode the pngs instead of the image package.

Related Issues

#39152

Tests

I did not add new tests, the existing test coverage should be sufficient.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.
    • I wrote a design doc: https://flutter.dev/go/template Replace this with a link to your design doc's short link
    • I got input from the developer relations team, specifically from: Replace with the names of who gave advice
    • I wrote a migration guide: Replace with a link to your migration guide

@jakemac53 jakemac53 requested a review from Piinks April 6, 2020 21:30
@fluttergithubbot fluttergithubbot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Apr 6, 2020
@fluttergithubbot
Copy link
Copy Markdown
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Copy Markdown
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

It looks like the flutter_goldens package will need to be updated as well.

@mit-mit mit-mit mentioned this pull request Apr 7, 2020
12 tasks
Copy link
Copy Markdown
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

It appears that local output is broken in this current state.
I manipulated an existing golden file in the framework and ran it locally. Here is the difference between what is currently on master and this change. I changed the background of the image to trigger the failure:

Master #54144
master image cupertino date_picker_test datetime initial_masterImage_e5508d2f1a43a33f584f7a15637c2f40 54144_cupertino date_picker_test datetime initial_masterImage_e5508d2f1a43a33f584f7a15637c2f40
test image cupertino date_picker_test datetime initial_testImage_e5508d2f1a43a33f584f7a15637c2f40 54144_cupertino date_picker_test datetime initial_testImage_e5508d2f1a43a33f584f7a15637c2f40
isolated diff cupertino date_picker_test datetime initial_isolatedDiff_e5508d2f1a43a33f584f7a15637c2f40 54144_cupertino date_picker_test datetime initial_isolatedDiff_e5508d2f1a43a33f584f7a15637c2f40
masked diff cupertino date_picker_test datetime initial_maskedDiff_e5508d2f1a43a33f584f7a15637c2f40 54144_cupertino date_picker_test datetime initial_maskedDiff_e5508d2f1a43a33f584f7a15637c2f40

I am going to see if I can write a test that would catch this, since all of the current tests are passing. It seems to me that this may be just be the invert function getting the wrong pixel.

@jakemac53
Copy link
Copy Markdown
Contributor Author

The invert function was definitely broken 🤦‍♂, it should be good to go now.

@jakemac53
Copy link
Copy Markdown
Contributor Author

hmm, I wrote a test using the images you provided above and it is not passing - I will continue digging here.

@jakemac53
Copy link
Copy Markdown
Contributor Author

HAH! I think I found out the reason. The getPixel method from the image package returns the pixel in #AABBGGRR format, while I am using #RRGGBBAA format. This causes the math.max call for the diff pixels to be wrong :D.

@Piinks
Copy link
Copy Markdown
Contributor

Piinks commented Apr 8, 2020

HAH! I think I found out the reason. The getPixel method from the image package returns the pixel in #AABBGGRR format, while I am using #RRGGBBAA format. This causes the math.max call for the diff pixels to be wrong :D.

Ah! 😆 I scratching my head over this, brilliant!

@jakemac53
Copy link
Copy Markdown
Contributor Author

I warned you I probably did things wrong! 🤣

@Piinks
Copy link
Copy Markdown
Contributor

Piinks commented Apr 8, 2020

Just checked against the test I uploaded above. Looks like it works now! 🎉

Copy link
Copy Markdown
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM

Thank you! There are a few nits below courtesy of the style guide, otherwise, this is great! 🎉

Co-Authored-By: Kate Lovett <katelovett@google.com>
@Piinks Piinks merged commit efdce3c into flutter:master Apr 9, 2020
@jakemac53 jakemac53 deleted the remove-image-dep branch April 9, 2020 18:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pixel and raw rgba functionality to Image class

4 participants