|
|
|
@ -199,7 +199,11 @@ public class Html2Image {
|
|
|
|
|
try {
|
|
|
|
|
File newPngFile = new File(pngFile.getAbsolutePath() + ".png");
|
|
|
|
|
pngFile.renameTo(newPngFile);
|
|
|
|
|
Image img = ImageParser.parse(pngFile.getAbsolutePath(), FileUtils.read(newPngFile));
|
|
|
|
|
final Image img = ImageParser.parse(pngFile.getAbsolutePath(), FileUtils.read(newPngFile));
|
|
|
|
|
if(img == null) {
|
|
|
|
|
/* Should not happen. If so, ImageParser.parse() should already have logged about the error */
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
final Image scaled = img.getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING);
|
|
|
|
|
final MediaTracker mediaTracker = new MediaTracker(new Container());
|
|
|
|
|
mediaTracker.addImage(scaled, 0);
|
|
|
|
|