diff options
author | Veselkov Konstantin <kostozyb@gmail.com> | 2018-09-15 21:23:36 +0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2018-09-15 13:23:36 -0400 |
commit | 7d57599b9d9c5fb48ea733596cbb812d7f84a8d6 (patch) | |
tree | 5c4b8a4ffd2fa420877bed0aea4eecc789316af0 /png.go | |
parent | 964b1221fa545d09ad62569f58a94dbbadaad57c (diff) |
fixed warnings gocritic 3.3 (#192)
Diffstat (limited to 'png.go')
-rw-r--r-- | png.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -96,11 +96,12 @@ func (f *Fpdf) parsepngstream(buf *bytes.Buffer, readdpi bool) (info *ImageInfoT // dbg("tRNS") // Read transparency info t := buf.Next(n) - if ct == 0 { + switch ct { + case 0: trns = []int{int(t[1])} // ord(substr($t,1,1))); - } else if ct == 2 { + case 2: trns = []int{int(t[1]), int(t[3]), int(t[5])} // array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1))); - } else { + default: pos := strings.Index(string(t), "\x00") if pos >= 0 { trns = []int{pos} // array($pos); |