lib/grim/page.rb in grim-0.2.3 vs lib/grim/page.rb in grim-0.2.4
- old
+ new
@@ -34,15 +34,15 @@
width = options.fetch(:width, Grim::WIDTH)
density = options.fetch(:density, Grim::DENSITY)
quality = options.fetch(:quality, Grim::QUALITY)
- SafeShell.execute("convert", "-resize", width, "-antialias", "-render",
+ output = SafeShell.execute("convert", "-resize", width, "-antialias", "-render",
"-quality", quality, "-colorspace", "RGB",
"-interlace", "none", "-density", density,
"#{@pdf.path}[#{@index}]", path)
- File.exists?(path)
+ $? == 0 || raise(UnprocessablePage, output)
end
# Extracts the text from the selected page.
#
# For example:
\ No newline at end of file