mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-16 15:20:20 +01:00
Be more verbose if image decoding failed.
This commit is contained in:
parent
08031f1dcd
commit
6ae5936de9
|
@ -93,14 +93,13 @@ func LoadPNG(path string) image.Image {
|
||||||
var err error
|
var err error
|
||||||
var file *os.File
|
var file *os.File
|
||||||
if file, err = os.Open(path); err != nil {
|
if file, err = os.Open(path); err != nil {
|
||||||
//log.Printf("WARN: %s\n", err)
|
|
||||||
return image.White
|
return image.White
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
reader := bufio.NewReader(file)
|
reader := bufio.NewReader(file)
|
||||||
var img image.Image
|
var img image.Image
|
||||||
if img, err = png.Decode(reader); err != nil {
|
if img, err = png.Decode(reader); err != nil {
|
||||||
log.Printf("WARN: %s\n", err)
|
log.Printf("WARN: decoding '%s' failed: %s\n", path, err)
|
||||||
return image.White
|
return image.White
|
||||||
}
|
}
|
||||||
return img
|
return img
|
||||||
|
|
Loading…
Reference in New Issue
Block a user