Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Sep 21, 2020

Description

Current implementation doesn't work and throws.

This implementation creates a BMP image from the pixel data and instantiates that.

Related Issues

Fixes flutter/flutter#49244

Tests

I added the following tests:

decodeImageFromPixels with both supported pixelformats.

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.

_createBmp(pixels, width, height, Endian.big, callback);
return;
case PixelFormat.bgra8888:
_createBmp(pixels, width, height, Endian.little, callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know enough about this but wouldn't the little-endian version of of rgba8888 be abgr8888? (i.e. not bgra8888) Or is it just a naming issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh, I think I need this to be working as if we're on Uint16 with the endianness swapped .. in which case, I might as well just do the swapping myself I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also forgot to handle rowbytes.

@yjbanov
Copy link
Contributor

yjbanov commented Sep 21, 2020

The web_tests issue is resolved. To fix the PR it needs to push a fresh new commit (or git --amend an existing one).

@dnfield dnfield marked this pull request as ready for review September 22, 2020 00:49
@dnfield
Copy link
Contributor Author

dnfield commented Sep 22, 2020

This is ready for review.

Null Function(Codec) callbacker = (Codec codec) {
codec.getNextFrame().then((FrameInfo frameInfo) {
callback(frameInfo.image);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

The signature says it returns Null but the body of the function looks like it's void.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 23, 2020
@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Linux Fuchsia has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 24, 2020
@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 24, 2020
@fluttergithubbot fluttergithubbot merged commit c0e1df6 into flutter:master Sep 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 24, 2020
@dnfield dnfield deleted the web_image_from_pixels branch August 18, 2021 18:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decodeImageFromList and decodeImageFromPixels returns Error: [object Event] at Object.createErrorWithStack

4 participants