URL: <http://puszcza.gnu.org.ua/bugs/?357>
Summary: Issues with image names containing spaces Project: tex4ht Submitted by: michal_h21 Submitted on: Sun 12 Mar 2017 05:47:21 PM EET Category: None Priority: 5 - Normal Severity: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: I've found strange issue with images whose filenames contain spaces (I know that it isn't a good idea, but sometimes you can't control your input): \documentclass{article} \usepackage{graphicx} \usepackage[space]{grffile} \DeclareGraphicsExtensions{.jpg} \begin{document} \includegraphics{"includes/Newman Crest"} \includegraphics{includes/Newman\space Crest} \includegraphics{includes/Newman Crest.jpg} \includegraphics{includes/Newman\space Crest.eps} \end{document} It produces the following code <!--l. 7--><p class="noindent" ><img src=""includes/Newman Crest".jpg" alt="PIC" width="135.50624pt" height="200.75pt" /> Crest.xbb <img src="includes/Newman Crest.jpg" alt="PIC" /> Crest.xbb <img src="includes/Newman Crest.jpg" alt="PIC" /> <img src="pathissue0x.png" alt="PIC" class="graphics" /><!--tex4ht:graphics name="pathissue0x.png" src="includes/Newman Crest.eps" --> </p> The issue with first image is that the quotes used in the filename messes with the quotes in HTML attributes, so the file isn't loaded properly. Second and third examples produces spurious `Crest.xbb` text. The last one has wrong resolution and the image is clipped, so only small part of it is displayed. I've modified the tex4ht sources to remove the quotes from the filename, which fixes the first issue. The second issue might be actually bug in the Graphics package. It tries to open the .xbb file with image dimensions, when it contains spaces, it tries to open only the part before space, the rest will end in the document. I've patched \Gread@eps macro to always include the quotes for .xbb loading. The last issue disappeared almost magically with these fixes, I am not really sure how :) Simple testing file is attached. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Sun 12 Mar 2017 05:47:21 PM EET Name: imagepath.zip Size: 71kB By: michal_h21 <http://puszcza.gnu.org.ua/bugs/download.php?file_id=277> _______________________________________________________ Reply to this item at: <http://puszcza.gnu.org.ua/bugs/?357> _______________________________________________ Message sent via/by Puszcza http://puszcza.gnu.org.ua/