summaryrefslogtreecommitdiff
path: root/png.go
diff options
context:
space:
mode:
authorVeselkov Konstantin <kostozyb@gmail.com>2018-09-15 21:23:36 +0400
committerKurt Jung <kurt.w.jung@gmail.com>2018-09-15 13:23:36 -0400
commit7d57599b9d9c5fb48ea733596cbb812d7f84a8d6 (patch)
tree5c4b8a4ffd2fa420877bed0aea4eecc789316af0 /png.go
parent964b1221fa545d09ad62569f58a94dbbadaad57c (diff)
fixed warnings gocritic 3.3 (#192)
Diffstat (limited to 'png.go')
-rw-r--r--png.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/png.go b/png.go
index 854b003..15002b3 100644
--- a/png.go
+++ b/png.go
@@ -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);