pdf2image icon indicating copy to clipboard operation
pdf2image copied to clipboard

Wrong version of poppler executable detected

Open nodje opened this issue 3 years ago • 4 comments

pdf2image.py:425 err.decode("utf8", "ignore").split("\n")[0].split(" ")[-1].split(".")[1] returns 10 for err =b'pdftocairo version 20.10.0\nCopyright 2005-2020 The Poppler Developers - http://poppler.freedesktop.org\nCopyright 1996-2011 Glyph & Cog, LLC\n' On Macos

nodje avatar Oct 22 '20 16:10 nodje

This is pretty bad. I will change how the version is detected. Thank you for reporting it.

Belval avatar Nov 06 '20 04:11 Belval

Hi @Belval I just had a quick look at this and just wanted to share an easy fix(that i'm sure you know) and one that is more robust.

Simple err.decode("utf8", "ignore").split("\n")[0].split(" ")[-1]

More robust re.findall("pdftocairo\sversion\s\d[0-100].\d[0-99].\d", err.decode("utf8", "ignore"))[0].split(" ")[2]

If you would like me to submit a PR just let me know what one you prefer. :)

ooojpeg avatar Dec 01 '20 21:12 ooojpeg

Yes actually, I haven't had time to look at this issue so if you can make a PR I'd appreciate it.

Belval avatar Dec 02 '20 23:12 Belval

@Belval Not sure if you had time to look at my PR or if you think anything needs changed. Thanks.

ooojpeg avatar Mar 23 '21 21:03 ooojpeg