]> git.lyx.org Git - features.git/commitdiff
* configure - pdftoppm is broken on windows.
authorPavel Sanda <sanda@lyx.org>
Sat, 27 Jan 2024 17:30:04 +0000 (18:30 +0100)
committerPavel Sanda <sanda@lyx.org>
Sat, 27 Jan 2024 17:35:08 +0000 (18:35 +0100)
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

index 5d0806e2678af99e8d3935ff8919d0182b4c9d71..9dd69c3cf805fd3b344dc59d3d2f341f0b8a69c8 100644 (file)
@@ -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.