commit 7eb5003a81ab24da86062ed703c94a4ecc858362
Author: Pavel Sanda <sa...@lyx.org>
Date:   Sat Jan 27 18:30:04 2024 +0100

    * configure - pdftoppm is broken on windows.
    
    From now we will use it only in case IM coders are really
    banned (so for windows we are back at 2.3 conversion chain).
    
    https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg221022.html
---
 lib/configure.py |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 5d0806e..9dd69c3 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1087,16 +1087,6 @@ def checkConverterEntries():
     # Only define a converter from pdf6 for graphics
     checkProg('a PDF to EPS converter', ['pdftops -eps -f 1 -l 1 $$i $$o'],
         rc_entry = [ r'\converter pdf6        eps        "%%"  ""' ])
-    # sips:Define a converter from pdf6 to png for Macs where pdftops is 
missing.
-    # The converter utility sips allows to force the dimensions of the 
resulting
-    # png image. The value of 800 pixel for the width is arbitrary and not
-    # related to the current screen resolution or width.
-    # There is no converter parameter for this information.
-    #
-    #pdftoppm: Some systems ban IM eps->png conversion. We will offer 
eps->pdf->png route instead.
-    checkProg('a PDF to PNG converter',
-        ['sips --resampleWidth 800 --setProperty format png $$i --out $$o' , 
'pdftoppm -r 72 -png -singlefile $$i >  $$o'],
-        rc_entry = [ r'\converter pdf6        png        "%%" ""' ])
     # Create one converter for a PDF produced using TeX fonts and one for a
     # PDF produced using non-TeX fonts. This does not produce non-unique
     # conversion paths, since a given document either uses TeX fonts or not.
@@ -1192,6 +1182,9 @@ def checkConverterEntries():
     checkProg('an EPS -> PDF converter', ['epstopdf'],
         rc_entry = [ r'\converter eps        pdf6       "epstopdf 
--outfile=$$o $$i"   ""'])
     #
+    #prepare for pdf -> png, 2nd part depends on IM ban below
+    pdftopng = ['sips --resampleWidth 800 --setProperty format png $$i --out 
$$o' ]
+    #
     # Due to more restrictive policies, it is possible that (image)magick
     # does not allow conversions from eps to png.
     # So before setting the converter test it it on a mock file
@@ -1211,6 +1204,19 @@ def checkConverterEntries():
 \converter jpg        tiff        "convert $$i $$o"    ""
 \converter png        tiff        "convert $$i $$o"    ""''')
             logger.info('ImageMagick seems to ban conversions from EPS. 
Disabling direct EPS->PNG.')
+            pdftopng.append('pdftoppm -r 72 -png -singlefile $$i >  $$o')
+    #
+    # PDF -> PNG: sips (mac), IM convert (windows, linux), pdftoppm (linux 
with IM ban)
+    # sips:Define a converter from pdf6 to png for Macs where pdftops is 
missing.
+    # The converter utility sips allows to force the dimensions of the 
resulting
+    # png image. The value of 800 pixel for the width is arbitrary and not
+    # related to the current screen resolution or width.
+    # There is no converter parameter for this information.
+    #
+    #pdftoppm: Some systems ban IM eps->png conversion. We will offer 
eps->pdf->png route instead.
+    checkProg('a PDF to PNG converter', pdftopng,
+        rc_entry = [ r'\converter pdf6        png        "%%" ""' ])
+
     #
     # no agr -> pdf6 converter, since the pdf library used by gracebat is not
     # free software and therefore not compiled in in many installations.
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to