mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
312 stars 34 forks source link

mutool call not working when the file path contains a space #233

Closed bgvoisin closed 1 year ago

bgvoisin commented 1 year ago

Consider the attached example (tiger.eps from the Ghostscript source, and tiger.pdf created from it with epstopdf). When the pdf file is placed in a directory without a space in its name, dvisvgm processes it fine. When the directory has a space in its name, processing fails.

Specifically, using the attached dvisvgm.zip:

% cd dvisvgm

% ls -lR
total 0
drwxr-xr-x  5 brunovoisin  staff  160 Mar 23 14:41 test folder
drwxr-xr-x  5 brunovoisin  staff  160 Mar 23 14:41 testfolder

./test folder:
total 232
-rw-r--r--  1 brunovoisin  staff  78687 Feb 28 19:06 tiger.eps
-rw-r--r--  1 brunovoisin  staff  34501 Mar 22 19:11 tiger.pdf

./testfolder:
total 232
-rw-r--r--  1 brunovoisin  staff  78687 Feb 28 19:06 tiger.eps
-rw-r--r--  1 brunovoisin  staff  34501 Mar 22 19:11 tiger.pdf

% cd testfolder

% dvisvgm --verbosity=7 --pdf tiger.pdf --output=%f-pdf.svg
processing PDF file
  graphic size: 552.0625pt x 570.13pt (194.027778mm x 200.377778mm)
  output written to tiger-pdf.svg
1 of 1 page converted in 0.130688 seconds

% cd ../"test folder"

% dvisvgm --verbosity=7 --pdf tiger.pdf --output=%f-pdf.svg
processing PDF file
  graphic size: 0pt x 0pt (0mm x 0mm)
  output written to tiger-pdf.svg
1 of 1 page converted in 0.082212 seconds

The same does not happen when calling libgs to process eps files, it's only when calling mutool to process pdf files.

I realized the above while sorting and archiving the tests from these past weeks: many directory names on my disk are in French and include both accents and spaces.

dvisvgm.zip

mgieseki commented 1 year ago

Thanks for reporting the bug. The patch I'm about to push should fix it.