summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2016-09-17 16:23:47 -0600
committerDan Allen <dan.j.allen@gmail.com>2016-09-17 16:23:47 -0600
commita461547715b63621a4a75c5f884f93855fecd796 (patch)
treed345732d7036f5bd740a68fcc1466bdfdfd51258
parentbd6c93a248d2e1f100f5574ab72d6449d082fc21 (diff)
assign image_path variable when image is a gif
-rw-r--r--lib/asciidoctor-pdf/converter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb
index 32c1f2ee..d07a16d8 100644
--- a/lib/asciidoctor-pdf/converter.rb
+++ b/lib/asciidoctor-pdf/converter.rb
@@ -826,6 +826,7 @@ class Converter < ::Prawn::Document
if image_format == 'gif'
warn %(asciidoctor: WARNING: GIF image format not supported. Please convert #{target} to PNG.) unless scratch?
+ image_path = nil
valid_image = false
elsif (image_path = resolve_image_path node, target, (opts.fetch :relative_to_imagesdir, true), image_format) &&
(::File.readable? image_path)
@@ -964,7 +965,7 @@ class Converter < ::Prawn::Document
end
theme_margin :block, :bottom
ensure
- unlink_tmp_file image_path
+ unlink_tmp_file image_path if image_path
end
# QUESTION can we avoid arranging fragments multiple times (conums & autofit) by eagerly preparing arranger?