mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-02 15:04:24 +02:00
fixes JDK bug: 5051418
This commit is contained in:
parent
932ef75635
commit
63b0dd1edb
@ -22,6 +22,8 @@ import brut.util.ExtDataInput;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.imageio.ImageTypeSpecifier;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,14 +39,10 @@ public class Res9patchStreamDecoder implements ResStreamDecoder {
|
|||||||
BufferedImage im = ImageIO.read(new ByteArrayInputStream(data));
|
BufferedImage im = ImageIO.read(new ByteArrayInputStream(data));
|
||||||
int w = im.getWidth(), h = im.getHeight();
|
int w = im.getWidth(), h = im.getHeight();
|
||||||
|
|
||||||
BufferedImage im2 = new BufferedImage(w + 2, h + 2,
|
ImageTypeSpecifier its = ImageTypeSpecifier.createFromRenderedImage( im );
|
||||||
BufferedImage.TYPE_4BYTE_ABGR);
|
BufferedImage im2 = its.createBufferedImage( w+2, h+2 );
|
||||||
if (im.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
|
|
||||||
im2.getRaster().setRect(1, 1, im.getRaster());
|
|
||||||
} else {
|
|
||||||
im2.getGraphics().drawImage(im, 1, 1, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
im2.getRaster().setRect(1, 1, im.getRaster());
|
||||||
NinePatch np = getNinePatch(data);
|
NinePatch np = getNinePatch(data);
|
||||||
drawHLine(im2, h + 1, np.padLeft + 1, w - np.padRight);
|
drawHLine(im2, h + 1, np.padLeft + 1, w - np.padRight);
|
||||||
drawVLine(im2, w + 1, np.padTop + 1, h - np.padBottom);
|
drawVLine(im2, w + 1, np.padTop + 1, h - np.padBottom);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user