mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-12 05:47:46 +01:00
Fix bug reencoding 9patch pngs
Fixes issue 1180. https://github.com/iBotPeaches/Apktool/issues/1180
This commit is contained in:
parent
5c7702396d
commit
ae6f8083f1
@ -39,10 +39,9 @@ public class Res9patchStreamDecoder implements ResStreamDecoder {
|
||||
BufferedImage im = ImageIO.read(new ByteArrayInputStream(data));
|
||||
int w = im.getWidth(), h = im.getHeight();
|
||||
|
||||
ImageTypeSpecifier its = ImageTypeSpecifier.createFromRenderedImage( im );
|
||||
BufferedImage im2 = its.createBufferedImage( w+2, h+2 );
|
||||
BufferedImage im2 = new BufferedImage( w+2, h+2, BufferedImage.TYPE_INT_ARGB );
|
||||
im2.createGraphics().drawImage( im, 1, 1, w, h, null );
|
||||
|
||||
im2.getRaster().setRect(1, 1, im.getRaster());
|
||||
NinePatch np = getNinePatch(data);
|
||||
drawHLine(im2, h + 1, np.padLeft + 1, w - np.padRight);
|
||||
drawVLine(im2, w + 1, np.padTop + 1, h - np.padBottom);
|
||||
@ -139,4 +138,4 @@ public class Res9patchStreamDecoder implements ResStreamDecoder {
|
||||
yDivs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user