mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-22 23:41:31 +01:00
Change the way images are cropped hopefully fixing #32
This commit is contained in:
parent
2f046b63d4
commit
677dfcda02
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user