Bug 1086715 - ImageMagick's JPEG files can no longer be used in pdflatex with the graphicx package
Summary: ImageMagick's JPEG files can no longer be used in pdflatex with the graphicx ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: texlive
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-11 11:26 UTC by Haakon Riiser
Modified: 2015-06-29 20:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 20:02:35 UTC
Type: Bug


Attachments (Terms of Use)

Description Haakon Riiser 2014-04-11 11:26:35 UTC
Description of problem:
After upgrading from Fedora 17 to Fedora 20, I can no longer embed (in pdflatex) JPEG images produced by ImageMagick using the "graphicx" LaTeX package. I am pretty sure this is a bug in ImageMagick, not texlive, because JPEG files produced by Fedora 20's ImageMagick fail in the same way when used with LaTeX on a Fedora 17 system.

Version-Release number of selected component (if applicable):
ImageMagick-6.8.6.3-3.fc20.x86_64

How reproducible:
Every time

Steps to Reproduce:

1. Create a JPEG file using ImageMagick:
$ convert -size 512x724 gradient:red-blue -sigmoidal-contrast 7x100% test_gradient.jpg

2. Create a minimal LaTeX document to embed it:
$ cat >test.tex <<\EOF                                
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[totalheight=\textheight]{test_gradient.jpg}
\end{document}
EOF

3. Run pdflatex on this document:
$ pdflatex test.tex

Actual results:
pdfTeX warning: pdflatex: arithmetic: number too big
<test_gradient.jpg, id=1, --32768.0pt x 0.0pt>
! Package graphics Error: Division by 0.
See the graphics package documentation for explanation.
Type  H <return>  for immediate help.
 ...
l.4 ...theight,keepaspectratio]{test_gradient.jpg}

Expected results:
No errors.

Comment 1 Haakon Riiser 2014-04-11 11:31:15 UTC
Forgot to mention that the totalheight= option to \includegraphics is necessary to reproduce this bug.

You can reproduce the bug no matter what value totalheight is set to, it does not have to be \textheight, but the bug does not manifest itself without totalheight.

Comment 2 Pavel Alexeev 2014-04-12 07:38:26 UTC
If you could open produced in ImageMagick file test_gradient.jpg than I assume it nothing do in ImageMagick side. Reassigning to texlive.

Comment 3 Haakon Riiser 2014-04-12 08:12:51 UTC
No, the error is definitely ImageMagick. The old ImageMagick works, the new one does not. Did you even try the steps I posted?

I believe there's something wrong in the JPEG's header values, take a look at this (output by the graphicx package:

<test_gradient.jpg, id=1, --32768.0pt x 0.0pt>

This _never_ happens when I use the old ImageMagick. The texlive version is the same, only the ImageMagick version differs. Reassigning to ImageMagick.

Comment 4 Pavel Alexeev 2014-04-13 10:38:35 UTC
$ identify test_gradient.jpg
test_gradient.jpg JPEG 512x724 512x724+0+0 8-bit sRGB 10.6KB 0.000u 0:00.000

ImageMagick itself correct show image parameters. So, I think it is something changed in upper software which ise it. Ho such parameters obtained in texlive? What command/API used and which parameters?

Comment 5 Haakon Riiser 2014-04-13 11:06:42 UTC
This is described in the original post:

Step 2: Create a minimal LaTeX document to embed it:
====================================================
$ cat >test.tex <<\EOF                                
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[totalheight=\textheight]{test_gradient.jpg}
\end{document}
EOF

Step 3: Run pdflatex on this document:
====================================================
$ pdflatex test.tex

Result
====================================================

pdfTeX warning: pdflatex: arithmetic: number too big
<test_gradient.jpg, id=1, --32768.0pt x 0.0pt>
! Package graphics Error: Division by 0.
See the graphics package documentation for explanation.
Type  H <return>  for immediate help.
 ...
l.4 ...theight,keepaspectratio]{test_gradient.jpg}
====================================================

If I use Fedora 20's texlive with Fedora 17's ImageMagick it still works. Hence, something has changed in ImageMagick that makes it fail.

Comment 6 Pavel Alexeev 2014-04-13 14:52:48 UTC
That I seen. But I do not familiar with latex. I ask about ImageMagick call, when it happened and how.

Comment 7 Haakon Riiser 2014-10-29 16:07:27 UTC
The problem is also discussed here:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26403

Apparently, there's a workaround: Specify the density when converting something to JPEG. E.g.,

convert -density 75 foo.bmp foo.jpg

The problem may be that pdflatex does not support the default JPEG density.

Comment 8 Fedora End Of Life 2015-05-29 11:32:28 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2015-06-29 20:02:35 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.