Created attachment 1377148 [details]
example with error
Description of problem:
The behaviour of the -annotate options of convert when using a newline in the text has changed in f27.
Version-Release number of selected component (if applicable):
ImageMagick 6.9.9-27 Q16 x86_64 2017-12-23
ImageMagick 6.9.9-19 Q16 x86_64 2017-10-11
convert -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png
Steps to Reproduce:
1. on a f27 system do: convert -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png
2. do the same command on a f26 system (or windows or macos)
3. compare results
on 1 line 2016 garbled with 0912 in a yellow rectangle
View the result with an image viewer.
in a yellow rectangle, view the result with an image viewer.
I downloaded ImageMagick-188.8.131.52-1.fc27.src.rpm and compiled it on a f26 system which did not show garbled text so the problem is not ImageMagick but something else in fedora 27.
Created attachment 1377149 [details]
I'm afraid I don't have a lot of time right now to hunt down the cause as it is outside of ImageMagick. It could be gcc, glibc, or bash. You're welcome to try and assigning this bug to those packages or working with upstream (ImageMagick) on finding the cause.
Did some testing and the problem seems to be with the urw fonts.
If on a f27 system I downgrade urw fonts by installing urw-fonts-2.4-23.fc26.noarch the new line gets back in my picture results. So changing component of this bug.
Did some more testing:
$ strace convert -size 30x25 xc:yellow -annotate +1+10 "2016\n0912" 20160912.png
I see /usr/share/fonts/urw-base35/NimbusSans-Regular.afm is being used as font on F27. So I downloaded urw-fonts-2.4-23.fc26.src.rpm and in there I found the file n019003l.afm which shows a line "FontName NimbusSanL-Regu". I then copied n019003l.afm to /usr/share/fonts/urw-base35/NimbusSans-Regular.afm after which I get expected results using convert. I did not check other NimbusSans files/fonts so at least the new NimbusSans-Regular.afm shows the error.
As a work around I can use the "-font" options with convert e.g.:
convert -size 30x25 xc:yellow -font NimbusSans-Regular -annotate +1+10 "2016\n0912" 20160912.jpg
renders a correct picture.
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30 Fedora will stop maintaining and issuing updates for
Fedora 27. 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 '27'.
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 27 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.