#670661 imagemagick: fails to convert correctly from svg to png in s390 architecture

Package:
libcairo2
Source:
cairo
Description:
Cairo 2D vector graphics library
Submitter:
Rino Del Campo
Date:
2012-12-05 22:00:07 UTC
Severity:
important
#670661#5
Date:
2012-04-27 17:44:14 UTC
From:
To:
Hi,

during several tests on s390 system I have noticed that convert command works
differently from amd64 binary. In detail, the conversion output from svg is
unreadable: wrong colors, wrong fonts.
I check the delegate libraries and they are the same on both
architectures.

"DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr
openexr png rsvg tiff x11 xml wmf zlib"

In the attachments there are:
- original svg (img0.svg)
- png output on s390 (img0_1.png)
- png output on amd64 (img0_2.png)

What is the difference?

Kind regards,
Rino

#670661#10
Date:
2012-05-31 20:03:22 UTC
From:
To:
tags 670661 + moreinfo
thanks

could you try  rsvg-view (or if no X rsvg-convert) on your svg file and report.

If png file output of rsvg-convert is incorrect bug lie in rsvg lib.

Thanks

bastien

#670661#17
Date:
2012-07-22 22:19:10 UTC
From:
To:
user 670661 debian-s390@lists.debian.org
usertags 670661 s390
thanks

Dear s390 user,

It seems that imagemagick fail on s390.

We believe it is a bug on rsvg lib. Could you try on porter box
rsvg-convert or rsvg-view with the svg file on the bug report  #670661
?

Thanks

Bastien

#670661#22
Date:
2012-07-23 09:39:11 UTC
From:
To:
On Mon, Jul 23, 2012 at 11:23 AM, Rino Del Campo <rino.delcampo@brain-debug.org> wrote:

Thanks,

It is really strange, because internally we use librsvg...

Will report upstream, but without a porter box it will be difficult
for upstream to solve...

Could you try to convert to jpeg instead of png ?

If it solve the problem lie in libpng.

Could you try with more recent version of imagemagick ?

Bastien

#670661#27
Date:
2012-07-23 10:36:51 UTC
From:
To:
The jpeg test returns same problem with image quality. (look at the attachment...)

What do you mean by "more recent version of imagemagick"? Do you refer to
version from testing or unstable branch?

Rino

#670661#32
Date:
2012-07-23 11:06:10 UTC
From:
To:
On Mon, Jul 23, 2012 at 12:36 PM, Rino Del Campo <rino.delcampo@brain-debug.org> wrote:

Yes the version from unstable

Bastien

#670661#37
Date:
2012-07-23 15:17:35 UTC
From:
To:
I have tried version 8:6.7.7.10-2 from unstable branch. The problem is still
there.

Rino

#670661#42
Date:
2012-07-23 15:23:32 UTC
From:
To:
Ok time to report upstream. I have no idea, and it is better that you
report the bug. You have a s390 and I have not.

Please mark this bug as fwd and I will prod upstream.

Report here
http://www.imagemagick.org/discourse-server/viewforum.php?f=3

Bastien

#670661#47
Date:
2012-07-23 19:46:51 UTC
From:
To:
tags 670661 + upstream
forwarded 670661 http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=21497
thanks

Dear pino,

Your bug has been forwarded.

Thank you very much to debug and help this problem on strange arch.

Cristy (upstream) is really helful in this case.

Thanks

Bastien

#670661#56
Date:
2012-07-28 00:59:35 UTC
From:
To:
Unfortunately we do not have access to a s390 host and without access we have little hope of resolving this problem.   The SVG coder utilizes the librsvg delegate library and renders either with Cairo or a GDK PIXBUF.  Possible root causes could be a bug in ImageMagick, the compiler, librsvg, Cairo, or the GDK PIXBUF.
Have you seen this problem on any other architecture?  Perhaps one we have access to?

We did try the conversion with the latest ImageMagick release under Fedora, CentOS 5.8, Windows 7, and Mac OS X and the rendering was proper.

Claire Parrish
ImageMagick Development Team

#670661#61
Date:
2012-07-28 05:08:47 UTC
From:
To:
Thanks but if you  post here  début patch wé are willing to  test on s390.

Rino do you  think ou could reproduce on hercule (s390 emulator)

Bastien
Le 28 juil. 2012 03:18, <claire.parrish@imagemagick.org> a écrit :

#670661#66
Date:
2012-07-28 05:11:01 UTC
From:
To:
So far it issu the only arch .
Le 28 juil. 2012 03:18, <claire.parrish@imagemagick.org> a écrit :

#670661#71
Date:
2012-08-01 14:32:23 UTC
From:
To:
I confirm what Bastien said. However, the only tested archs are amd64 and
s390. No other ones.
I think is possible to reproduce the environment with hercules. I can try and
show you the steps.

Rino

#670661#76
Date:
2012-08-02 17:40:06 UTC
From:
To:
Yes do it please.

Bastien

#670661#81
Date:
2012-08-02 17:49:12 UTC
From:
To:
On Thu, Aug 2, 2012 at 7:40 PM, Bastien ROUCARIES <roucaries.bastien@gmail.com> wrote:

And BTW ask for compiling qemu with s390 support (s390x is already installed)

#670661#86
Date:
2012-09-28 11:30:07 UTC
From:
To:
Type 'convert -list format'.  Is RSVG associated with the SVG tag?  If not, add --with-rsvg to the configure command line when you build ImageMagick.

We downloaded ImageMagick-6.6.0-10.tar.gz to the s390 emulator and installed RSVG and RSVG development packages.  We built and installed ImageMagick and it rendered img0.svg properly.   If that fails, edit magick/magick-config.h and comment out the MAGICKCORE_CAIRO_DELEGATE define.  Now rebuild and reinstall.  Does that produce a proper rendering?   Recent versions of ImageMagick utilize the PANGO renderer and may return superior results.

If all else fails, you can delete the svg.so module and ImageMagick will revert to the rsvg delegate program and return proper results.

Note, the SVG code has changed very little over the last several years and it primarily relies on delegate libraries such as RSVG, Pango, and Cairo.  The img0.svg image renders for us on all the systems we tried, CentOS, Redhat, Fedora, and Mac.   It seems likely that the problem may be the CAIRO rendering specifically on the s390.   When we commented out the MAGICKCORE_CAIRO_DELEGATE, the image rendered properly.  If MAGICKCORE_CAIRO_DELEGATE is not defined, ImageMagick reverts to direct GDK rendering

We would have more detailed results but we got a bit frustrated with the s390 emulator.  It took more than 30 minutes each time we made a change and attempted to rebuild and reinstall ImageMagick.   Its just a few minutes on our 6 core physical machine.

Claire Parrish
ImageMagick Development Team

#670661#91
Date:
2012-10-12 14:57:47 UTC
From:
To:
reassign 670661 libcairo2
affects 670661 imagemagick
thanks

Dear cairo mainteners,

Under s390 imagemagick when using libcairo routine fail to produce
correct png from svg, but correctly produce using other means.

So I reaffect this bug on your side.

Thanks you

bastien