Change the way images are cropped hopefully fixing #32

This commit is contained in:
Blue (Lukas Rieger) 2020-04-09 17:56:08 +02:00
parent 2f046b63d4
commit 677dfcda02

View File

@ -24,7 +24,6 @@
*/
package de.bluecolored.bluemap.core.resourcepack;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -199,9 +198,8 @@ public synchronized Texture loadTexture(FileAccess fileAccess, String path) thro
//crop off animation frames
if (image.getHeight() > image.getWidth()){
BufferedImage cropped = new BufferedImage(image.getWidth(), image.getWidth(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = cropped.createGraphics();
g.drawImage(image, 0, 0, null);
BufferedImage cropped = new BufferedImage(image.getWidth(), image.getWidth(), image.getType());
image.copyData(cropped.getRaster());
image = cropped;
}