Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
poppler_version = _get_poppler_version(
"pdftocairo" if use_pdfcairo else "pdftoppm", poppler_path=poppler_path
)
if poppler_version <= 57:
jpegopt = None
# If output_file isn't a generator, it will be turned into one
if not isinstance(output_file, types.GeneratorType) and not isinstance(
output_file, ThreadSafeGenerator
):
if single_file:
output_file = iter([output_file])
else:
output_file = counter_generator(output_file)
if thread_count < 1:
thread_count = 1
if first_page is None:
first_page = 1
if last_page is None or last_page > page_count:
last_page = page_count
if first_page > last_page:
return []
auto_temp_dir = False
if output_folder is None and use_pdfcairo:
auto_temp_dir = True