Skip to content

Commit 677dfcd

Browse files
committed
Change the way images are cropped hopefully fixing #32
1 parent 2f046b6 commit 677dfcd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/TextureGallery.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
package de.bluecolored.bluemap.core.resourcepack;
2626

27-
import java.awt.Graphics2D;
2827
import java.awt.image.BufferedImage;
2928
import java.io.ByteArrayOutputStream;
3029
import java.io.File;
@@ -199,9 +198,8 @@ public synchronized Texture loadTexture(FileAccess fileAccess, String path) thro
199198

200199
//crop off animation frames
201200
if (image.getHeight() > image.getWidth()){
202-
BufferedImage cropped = new BufferedImage(image.getWidth(), image.getWidth(), BufferedImage.TYPE_INT_ARGB);
203-
Graphics2D g = cropped.createGraphics();
204-
g.drawImage(image, 0, 0, null);
201+
BufferedImage cropped = new BufferedImage(image.getWidth(), image.getWidth(), image.getType());
202+
image.copyData(cropped.getRaster());
205203
image = cropped;
206204
}
207205

0 commit comments

Comments
 (0)