diff --git a/bin/mindee.rb b/bin/mindee.rb index e14db930..6c303ef1 100755 --- a/bin/mindee.rb +++ b/bin/mindee.rb @@ -99,7 +99,7 @@ def custom_subcommand(cli_parser, options) end if options[:cut_pages].nil? || !options[:cut_pages].is_a?(Integer) || options[:cut_pages] < 0 - page_options = options[:cut_pages].nil? + page_options = nil else page_options = Mindee::PageOptions.new(params: { page_indexes: (0..options[:cut_pages].to_i).to_a, diff --git a/lib/mindee/client.rb b/lib/mindee/client.rb index 1ea903f5..07f62a9e 100644 --- a/lib/mindee/client.rb +++ b/lib/mindee/client.rb @@ -323,8 +323,7 @@ def enqueue_and_parse(input_source, product_class, endpoint, options) def execute_workflow(input_source, workflow_id, options: {}) opts = options.is_a?(WorkflowOptions) ? options : WorkflowOptions.new(params: options) if opts.respond_to?(:page_options) && input_source.is_a?(Input::Source::LocalInputSource) - process_pdf_if_required(input_source, - opts) + process_pdf_if_required(input_source, opts) end workflow_endpoint = Mindee::HTTP::WorkflowEndpoint.new(workflow_id, api_key: @api_key) @@ -496,7 +495,7 @@ def normalize_parse_options(options) # @param opts [ParseOptions] def process_pdf_if_required(input_source, opts) return unless input_source.is_a?(Mindee::Input::Source::LocalInputSource) && - opts.page_options && + opts.page_options.on_min_pages && input_source.pdf? input_source.process_pdf(opts.page_options)