summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-08-19 09:42:15 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-08-19 09:42:15 -0400
commit27b605858db6d8f5439e9b689f70626801324f02 (patch)
treeb9ed9cb126f0ba8cbd26dc7282a30a9aa0c1a389 /fpdf.go
parentc2852e54f9dab4886e4679e7bb48513510444f02 (diff)
Add image information retrieval method and test
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/fpdf.go b/fpdf.go
index c7042c7..470a81b 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2358,6 +2358,18 @@ func (f *Fpdf) RegisterImage(fileStr, tp string) (info *ImageInfoType) {
return f.RegisterImageReader(fileStr, tp, file)
}
+// GetImageInfo returns information about the registered image specified by
+// imageStr. If the image has not been registered, an empty structure followed
+// by false is returned. The internal error is not modified by this method.
+func (f *Fpdf) GetImageInfo(imageStr string) (info ImageInfoType, ok bool) {
+ var infoPtr *ImageInfoType
+ infoPtr, ok = f.images[imageStr]
+ if ok {
+ info = *infoPtr
+ }
+ return
+}
+
// GetXY returns the abscissa and ordinate of the current position.
//
// Note: the value returned for the abscissa will be affected by the current