-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add image accessor to MGLStyle #7096
Add image accessor to MGLStyle #7096
Conversation
@rmnblm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @boundsj, @frederoni and @jfirebaugh to be potential reviewers. |
@1ec5 Just a small reminder ⏱ (I'm pretty sure that you're totally busy and that's okay, just let me know if you need more details or something I can do |
Hi @rmnblm, this is on my plate to take a look at. Indeed, it’s a little busy with the holiday season and preparations for the v3.4.0 release. Thanks for your patience! Incidentally, I think it would be nice to get this fix into v3.4.x given that it rounds out the runtime styling API. For that to happen, please retarget this PR at the release-ios-v3.4.0 branch, where we’re developing v3.4.0 and subsequent patch releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmnblm, thanks for retargeting this PR. It needs to be rebased on the release-ios-v3.4.0 branch as well. I can take care of that, but first you’ll need to check the “allow maintainers to edit this branch” box.
return nil; | ||
} | ||
|
||
auto imageData = [NSData dataWithBytes:spriteImage->image.data.get() length:spriteImage->image.bytes()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PremultipliedImage
has a field called size
that likely has what you want.
@1ec5 I enabled "Allow edits from maintainers." 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All set.
Convert from sprite images to platform images using the existing encodePNG() function, which is also used for printing. Allow -imageForName: to return nil without an assertion failure. Added a basic test.
Thanks for your contribution, @rmnblm! |
9456bec fixes an mbgl test failure caused by this PR. For future reference, if you make changes to mbgl or its tests, please run |
Thanks for merging and especially fixing the subsequent issue @1ec5. |
No worries. Looking forward to your future PRs! 😃 |
@1ec5: I'm struggling a bit right now. Could you give a quick review for the current state of implementation to see if I'm heading into the right direction? What's currently not working is to initialize an MGLImage from the byte array of a sprite image.
This PR resolves issue #7012.