diff options
author | Jelmer Snoeck <jelmer.snoeck@gmail.com> | 2015-08-26 19:44:21 +0100 |
---|---|---|
committer | Jelmer Snoeck <jelmer.snoeck@gmail.com> | 2015-08-26 19:44:21 +0100 |
commit | 74253e5c9ca7edeee98bcf4b38d9ef1d00fe7a0e (patch) | |
tree | 2b6bbb28cfcd448e3fbac964dc05b1e721ba4281 | |
parent | a1dcf58b5248a95377100a535eb7d20f708cf6a0 (diff) |
HttpImg: use `Register` method.
By changing the name, we can use a uniform name across several packages.
-rw-r--r-- | contrib/httpimg/httpimg.go | 8 | ||||
-rw-r--r-- | contrib/httpimg/httpimg_test.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/contrib/httpimg/httpimg.go b/contrib/httpimg/httpimg.go index 6025469..10afcc8 100644 --- a/contrib/httpimg/httpimg.go +++ b/contrib/httpimg/httpimg.go @@ -5,10 +5,10 @@ import ( "net/http" ) -// RegisterHttpImage registers a HTTP image. Downloading the image from the -// provided URL and adding it to the PDF but not adding it to the page. Use -// Image() with the same URL to add the image to the page. -func RegisterHttpImage(f *gofpdf.Fpdf, urlStr, tp string) (info *gofpdf.ImageInfoType) { +// Register registers a HTTP image. Downloading the image from the provided URL +// and adding it to the PDF but not adding it to the page. Use Image() with the +// same URL to add the image to the page. +func Register(f *gofpdf.Fpdf, urlStr, tp string) (info *gofpdf.ImageInfoType) { info = f.GetImageInfo(urlStr) if info != nil { diff --git a/contrib/httpimg/httpimg_test.go b/contrib/httpimg/httpimg_test.go index d1b97bb..cc007c6 100644 --- a/contrib/httpimg/httpimg_test.go +++ b/contrib/httpimg/httpimg_test.go @@ -32,7 +32,7 @@ func ExampleFpdf_AddHttpImage() { pdf.AddPage() url := "https://github.com/jung-kurt/gofpdf/raw/master/image/logo_gofpdf.jpg?raw=true" - httpimg.RegisterHttpImage(pdf, url, "") + httpimg.Register(pdf, url, "") pdf.Image(url, 100, 100, 20, 20, false, "", 0, "") fileStr := exampleFilename("Fpdf_AddHttpImage") |