mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add logging
This commit is contained in:
@@ -49,11 +49,17 @@ internal fun imageSize(file: File): Dimension? {
|
||||
}
|
||||
|
||||
internal fun loadImage(file: File): Image? {
|
||||
if (file.name.endsWith(".svg")) {
|
||||
return SVGLoader.load(file.toURI().toURL(), 1.0f)
|
||||
try {
|
||||
if (file.name.endsWith(".svg")) {
|
||||
return SVGLoader.load(file.toURI().toURL(), 1.0f)
|
||||
}
|
||||
else {
|
||||
return ImageIO.read(file)
|
||||
}
|
||||
}
|
||||
else {
|
||||
return ImageIO.read(file)
|
||||
catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user