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

Res9patchStreamDecoder.java decodes incorrectly on non-RGBA 9patch PNGs #1180

Closed
mattsarett opened this Issue Mar 3, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@mattsarett
Contributor

mattsarett commented Mar 3, 2016

PNGs may encoded in multiple different formats (ex: Color table, RGB, RGBA, Gray, GrayAlpha etc.). Previous versions of aapt would always use an RGBA encoding on 9patch PNGs.

The upcoming version of aapt will encode 9patch PNGs in any format. This triggers a bug in Res9patchStreamDecoder.java, where some types of PNGs are handled incorrectly.

I'm currently working on a fix for this. Would you be receptive to taking this fix? Please let me know if you have any thoughts or input!

Best,
Matt

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 3, 2016

Owner

By upcoming aapt do you mean aapt2? Or a patch aapt release?

I'm aware of plenty of bugs with our 9patch decoder. I've been meaning to update it in spec with the new format listed here - https://github.com/iBotPeaches/platform_frameworks_base/blob/apktool-mm/include/androidfw/ResourceTypes.h#L50 , but life and other bugs have gotten the best of me.

Any fix towards 9 patch will be appreciated.

Owner

iBotPeaches commented Mar 3, 2016

By upcoming aapt do you mean aapt2? Or a patch aapt release?

I'm aware of plenty of bugs with our 9patch decoder. I've been meaning to update it in spec with the new format listed here - https://github.com/iBotPeaches/platform_frameworks_base/blob/apktool-mm/include/androidfw/ResourceTypes.h#L50 , but life and other bugs have gotten the best of me.

Any fix towards 9 patch will be appreciated.

@mattsarett

This comment has been minimized.

Show comment
Hide comment
@mattsarett

mattsarett Mar 3, 2016

Contributor

I mean the aapt that will ship with upcoming versions of Android. I don't really know much about aapt2.

I'm hopeful that the fix will be somewhat simple and won't interfere with any future plans to support more 9patch features.

Contributor

mattsarett commented Mar 3, 2016

I mean the aapt that will ship with upcoming versions of Android. I don't really know much about aapt2.

I'm hopeful that the fix will be somewhat simple and won't interfere with any future plans to support more 9patch features.

mattsarett added a commit to mattsarett/Apktool that referenced this issue Mar 3, 2016

@mattsarett

This comment has been minimized.

Show comment
Hide comment
@mattsarett

mattsarett Mar 3, 2016

Contributor

I think I have the fix here:
mattsarett@ae6f808

I plan to submit a pull request, but I'd like to wait to make sure it passes all of my tests.

Contributor

mattsarett commented Mar 3, 2016

I think I have the fix here:
mattsarett@ae6f808

I plan to submit a pull request, but I'd like to wait to make sure it passes all of my tests.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 24, 2016

Owner

Fixed by - #1182

Owner

iBotPeaches commented Mar 24, 2016

Fixed by - #1182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment