From e27b17d1defd471e6f0c0c422d2fa8ce9b9c3bb6 Mon Sep 17 00:00:00 2001 From: Joe Westcott Date: Fri, 30 Aug 2019 14:31:30 +0100 Subject: comments for ImageInfoType --- def.go | 28 ++++++++++++++-------------- fpdf.go | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/def.go b/def.go index 7fddc82..47e5135 100644 --- a/def.go +++ b/def.go @@ -165,20 +165,20 @@ func (p PointType) XY() (float64, float64) { // Changes to this structure should be reflected in its GobEncode and GobDecode // methods. type ImageInfoType struct { - data []byte - smask []byte - n int - w float64 - h float64 - cs string - pal []byte - bpc int - f string - dp string - trns []int - scale float64 // document scaling factor - dpi float64 - i string + data []byte // Raw image data + smask []byte // Soft Mask, an 8bit per-pixel transparency mask + n int // Image object number + w float64 // Width + h float64 // Height + cs string // Color space + pal []byte // Image color palette + bpc int // Bits Per Component + f string // Image filter + dp string // DecodeParms + trns []int // Transparency mask + scale float64 // Document scale factor + dpi float64 // Dots-per-inch found from image file (png only) + i string // SHA-1 checksum of the above values. } func generateImageID(info *ImageInfoType) (string, error) { diff --git a/fpdf.go b/fpdf.go index f77717f..24e79bc 100644 --- a/fpdf.go +++ b/fpdf.go @@ -4215,6 +4215,7 @@ func implode(sep string, arr []int) string { return s.String() } +// arrayCountValues counts the occurrences of each item in the $mp array. func arrayCountValues(mp []int) map[int]int { answer := make(map[int]int) for _, v := range mp { -- cgit v1.2.1-24-ge1ad