From baeae06d18fa3e070ab0bc88d984e05029e87c56 Mon Sep 17 00:00:00 2001 From: alafr Date: Mon, 17 Oct 2016 20:52:37 +0300 Subject: [PATCH] Fix for #559 --- lib/mixins/images.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mixins/images.coffee b/lib/mixins/images.coffee index 91a62e8..e532194 100644 --- a/lib/mixins/images.coffee +++ b/lib/mixins/images.coffee @@ -13,7 +13,7 @@ module.exports = x = x ? options.x ? @x y = y ? options.y ? @y - unless Buffer.isBuffer(src) + if typeof src is 'string' image = @_imageRegistry[src] if not image @@ -88,12 +88,12 @@ module.exports = return this openImage: (src) -> - unless Buffer.isBuffer(src) + if typeof src is 'string' image = @_imageRegistry[src] if not image image = PDFImage.open src, 'I' + (++@_imageCount) - unless Buffer.isBuffer(src) + if typeof src is 'string' @_imageRegistry[src] = image return image