git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c175bf6
)
Fix undocumented exception in SaveImageAwt
author
Niki Roo
<niki@nikiroo.be>
Sun, 12 Aug 2018 20:40:07 +0000
(22:40 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Sun, 12 Aug 2018 20:40:07 +0000
(22:40 +0200)
src/be/nikiroo/utils/ui/ImageUtilsAwt.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/utils/ui/ImageUtilsAwt.java
b/src/be/nikiroo/utils/ui/ImageUtilsAwt.java
index 0c69dc4482938ae02608be704167e23a8add13e0..3acbe55f9c23ad482d9ecc533bcd0e138fa8c92d 100644
(file)
--- a/
src/be/nikiroo/utils/ui/ImageUtilsAwt.java
+++ b/
src/be/nikiroo/utils/ui/ImageUtilsAwt.java
@@
-36,7
+36,14
@@
public class ImageUtilsAwt extends ImageUtils {
// Some formats are not reliable
// Second chance: PNG
if (!ok && !format.equals("png")) {
- ok = ImageIO.write(image, "png", target);
+ try {
+ ok = ImageIO.write(image, "png", target);
+ } catch (IllegalArgumentException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IOException("Undocumented exception occured, "
+ + "converting to IOException", e);
+ }
}
if (!ok) {