Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trimming Image Leads to Negative Scaling #2406

Open
Xaldew opened this issue Aug 23, 2024 · 0 comments
Open

Trimming Image Leads to Negative Scaling #2406

Xaldew opened this issue Aug 23, 2024 · 0 comments

Comments

@Xaldew
Copy link

Xaldew commented Aug 23, 2024

There seems to be some kind of bug with any includeimage macro that uses the trim and clip options:

\documentclass[acmsmall,screen]{acmart}

\begin{document}
\begin{figure}
  \includegraphics[width=0.1325\columnwidth,trim={630 0 690 0},clip]{img/new_sponza_twig-2state-1level-micromap_00.png}
\end{figure}
\end{document}

This appears to lead to a scaling operation to a negative target dimension, which, I suspect, becomes an integer underflow, causing an imagemagick size policy to fail:

max_print_line=10000 TEXINPUTS="/home/xaldew/git/phd/phd/blog/micromaps:/home/xaldew/git/phd/phd/blog/micromaps/tex:/home/xaldew/git/phd/phd/blog/micromaps/sty:" BIBINPUTS="/home/xaldew/git/phd/phd/blog/micromaps:/home/xaldew/git/phd/phd/blog/micromaps/bib:/home/xaldew/git/phd/phd/blog/micromaps/tex:/home/xaldew/git/phd/phd/blog/micromaps/sty:" BSTINPUTS="/home/xaldew/git/phd/phd/blog/micromaps:/home/xaldew/git/phd/phd/blog/micromaps/sty:" latexmlc docs/test/test.tex --destination=docs/test/test.html
latexmlc (LaTeXML version 0.8.8)
processing started Fri Aug 23 07:32:57 2024
Conversion complete: No obvious problems
Error:imageprocessing:Scale Image processing operation Scale (width, 159, height, -98) returned Exception 465: width or height exceeds limit `/home/xaldew/git/phd/phd/blog/micromaps/docs/test/img/new_sponza_twig-2state-1level-micromap_00.png' @ error/cache.c/OpenPixelCache/3909
Warning:expected:image Couldn't get usable image for /home/xaldew/git/phd/phd/blog/micromaps/docs/test/img/new_sponza_twig-2state-1level-micromap_00.png
Post-processing complete: 1 warning; 1 error (See /home/xaldew/git/phd/phd/blog/micromaps/test.latexml.log)
Status:conversion:2

The image in question is a 1920x1080 rendering well within the imagemagick policy sizes.

I've included a Zip-file with the above tex-source and image that leads to this error. Hope that helps!
test.zip

@dginev dginev added this to the LaTeXML-0.9 milestone Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants