From 84296ad0de25bc27403a0566119569152faa6d9f Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 7 Mar 2016 19:29:25 -0500 Subject: Satisfy golint with small changes to documentation. Remove diagnostic print statement to allow tests to succeed. --- def.go | 9 ++++----- fpdf.go | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/def.go b/def.go index d3eaca0..f5eed3a 100644 --- a/def.go +++ b/def.go @@ -111,11 +111,10 @@ func (info *ImageInfoType) Height() float64 { return info.h / (info.scale * info.dpi / 72) } -// Dpi sets the dots per inch for an image -// PNG images MAY have their dpi set automatically, if the image -// specifies it. DPI information is not currently available -// automatically for JPG and GIF images, so if it's important to -// you, you can set it here. It defaults to 72 dpi. +// SetDpi sets the dots per inch for an image. PNG images MAY have their dpi +// set automatically, if the image specifies it. DPI information is not +// currently available automatically for JPG and GIF images, so if it's +// important to you, you can set it here. It defaults to 72 dpi. func (info *ImageInfoType) SetDpi(dpi float64) { info.dpi = dpi } diff --git a/fpdf.go b/fpdf.go index 4581cda..952556a 100644 --- a/fpdf.go +++ b/fpdf.go @@ -2309,15 +2309,15 @@ func (f *Fpdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp stri f.ImageOptions(imageNameStr, x, y, w, h, flow, options, link, linkStr) } -// Image puts a JPEG, PNG or GIF image in the current page. The size it will -// take on the page can be specified in different ways. If both w and h are 0, -// the image is rendered at 96 dpi. If either w or h is zero, it will be +// ImageOptions puts a JPEG, PNG or GIF image in the current page. The size it +// will take on the page can be specified in different ways. If both w and h +// are 0, the image is rendered at 96 dpi. If either w or h is zero, it will be // calculated from the other dimension so that the aspect ratio is maintained. -// If w and/or h are -1, the dpi for that dimension will be read from -// the ImageInfoType object. PNG files can contain dpi information, and if -// present, this information will be populated in the ImageInfoType object -// and used in Width, Height, and Extent calculations. Otherwise, the -// SetDpi function can be used to change the dpi from the default of 72. +// If w and/or h are -1, the dpi for that dimension will be read from the +// ImageInfoType object. PNG files can contain dpi information, and if present, +// this information will be populated in the ImageInfoType object and used in +// Width, Height, and Extent calculations. Otherwise, the SetDpi function can +// be used to change the dpi from the default of 72. // // If w and h are any other negative value, their absolute values // indicate their dpi extents. @@ -2445,9 +2445,9 @@ func (f *Fpdf) RegisterImage(fileStr, tp string) (info *ImageInfoType) { return f.RegisterImageOptions(fileStr, options) } -// RegisterImage registers an image, adding it to the PDF file but not adding -// it to the page. Use Image() with the same filename to add the image to the -// page. Note that Image() calls this function, so this function is only +// RegisterImageOptions registers an image, adding it to the PDF file but not +// adding it to the page. Use Image() with the same filename to add the image +// to the page. Note that Image() calls this function, so this function is only // necessary if you need information about the image before placing it. See // Image() for restrictions on the image and the "tp" parameters. func (f *Fpdf) RegisterImageOptions(fileStr string, options ImageOptions) (info *ImageInfoType) { @@ -2913,8 +2913,8 @@ func (f *Fpdf) parsepngstream(buf *bytes.Buffer, readdpi bool) (info *ImageInfoT x := int(f.readBeInt32(buf)) y := int(f.readBeInt32(buf)) units := buf.Next(1)[0] - fmt.Printf("got a pHYs block, x=%d, y=%d, u=%d, readdpi=%t\n", - x, y, int(units), readdpi) + // fmt.Printf("got a pHYs block, x=%d, y=%d, u=%d, readdpi=%t\n", + // x, y, int(units), readdpi) // only modify the info block if the user wants us to if x == y && readdpi { switch units { -- cgit v1.2.1-24-ge1ad