mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
Added printing of supported formats, in case ImageIO could not read image in main method.
This commit is contained in:
parent
e852e9e154
commit
fa69918adb
@ -44,6 +44,7 @@ import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
@ -307,6 +308,10 @@ public abstract class ImageReaderBase extends ImageReader {
|
||||
|
||||
public static void main(String[] pArgs) throws IOException {
|
||||
BufferedImage image = ImageIO.read(new File(pArgs[0]));
|
||||
if (image == null) {
|
||||
System.err.println("Supported formats: " + Arrays.toString(ImageIO.getReaderFormatNames()));
|
||||
System.exit(1);
|
||||
}
|
||||
showIt(image, pArgs[0]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user