commit 7c14ff94e31990eb0932f55942edb75f30f6b24d
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sun Jul 9 22:27:06 2017 +0200

    Fix bug #10718
    
    Due to the peculiarities of Windows, it may happen that
    pdftocairo is built without png support when compiled on this
    platform. Unless explicitly requested (maybe for some peculiar
    application and certainly not for usual distros), this is
    highly improbable to occur on other platforms.
---
 lib/scripts/legacy_lyxpreview2ppm.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/scripts/legacy_lyxpreview2ppm.py 
b/lib/scripts/legacy_lyxpreview2ppm.py
index 99f4e56..c40cd89 100644
--- a/lib/scripts/legacy_lyxpreview2ppm.py
+++ b/lib/scripts/legacy_lyxpreview2ppm.py
@@ -417,6 +417,10 @@ def legacy_conversion_step3(latex_file, dpi, 
output_format, dvips_failed, skipMe
     pdftocairo = find_exe(["pdftocairo"])
     epstopdf   = find_exe(["epstopdf"])
     use_pdftocairo = pdftocairo != None and output_format == "png"
+    if use_pdftocairo and os.name == 'nt':
+        # On Windows, check for png support (see #10718)
+        conv_status, conv_stdout = run_command("%s --help" % pdftocairo)
+        use_pdftocairo = '-png' in conv_stdout
     if use_pdftocairo:
         conv = pdftocairo
     else:

Reply via email to