mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-08 03:00:26 +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 file *os.File
|
||||
if file, err = os.Open(path); err != nil {
|
||||
//log.Printf("WARN: %s\n", err)
|
||||
return image.White
|
||||
}
|
||||
defer file.Close()
|
||||
reader := bufio.NewReader(file)
|
||||
var img image.Image
|
||||
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 img
|
||||
|
|
Loading…
Reference in New Issue
Block a user