lib/libis/format/converter/pdf_converter.rb in libis-format-0.9.25 vs lib/libis/format/converter/pdf_converter.rb in libis-format-0.9.27

- old
+ new

@@ -101,17 +101,16 @@ def convert(source, target, format, opts = {}) super result = nil - unless @options.empty? + if (quality = @options.delete('optimize')) + result = optimize_pdf(source, target, quality) + return nil unless result + source = result + end - if (quality = @options.delete('optimize')) - result = optimize_pdf(source, target, quality) - return nil unless result - source = result - end - + unless @options.empty? result = convert_pdf(source, target) return nil unless result source = result end