After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760262 - 2.40.11 regression: CLI parameter for zoom just increases image frame but not the image
2.40.11 regression: CLI parameter for zoom just increases image frame but not...
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.40.x
Other Linux
: High major
: ---
Assigned To: librsvg maintainers
librsvg maintainers
: 756340 757484 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-01-07 11:30 UTC by mik@gmx.org
Modified: 2016-06-05 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Quick solution use Cairo API scale (361 bytes, patch)
2016-01-07 11:36 UTC, mik@gmx.org
none Details | Review
Fix bug 760262 2.40.11 regression: CLI parameter for zoom (6.21 KB, patch)
2016-04-02 13:05 UTC, mik@gmx.org
none Details | Review
Provide measures for CLI testing (5.78 KB, patch)
2016-04-08 08:07 UTC, mik@gmx.org
none Details | Review
Patch providing measures for CLI testing and more (8.63 KB, patch)
2016-06-04 08:01 UTC, mik@gmx.org
none Details | Review
Provide measures for CLI testing and more (7.99 KB, patch)
2016-06-05 10:22 UTC, mik@gmx.org
none Details | Review

Description mik@gmx.org 2016-01-07 11:30:39 UTC
Between 2.40.10 and 2.40.10 an API call marked as deprecated has been removed. This breaks any CLI call of rsvg-convert requesting resizing of SVG during rendering. While the frame of the generated PNG grows the image isn't scaled.

Example call:

rsvg-convert test.svg -f png -z 10 -o test-10-ref.png

The manual says to use some Cairo API as replacement of deprecated API:
https://developer.gnome.org/rsvg/stable/RsvgHandle.html#rsvg-handle-set-size-callback
Comment 1 mik@gmx.org 2016-01-07 11:36:07 UTC
Created attachment 318410 [details] [review]
Quick solution use Cairo API scale

Important: It works fine, but I havn't tested if it has flaws.

The major issue I'm unsure about is worsening aliasing arte-facts with e.g. exact 1px thick lines to be placed exactly to the raster.
Comment 2 mik@gmx.org 2016-01-07 11:36:42 UTC
Between 2.40.10 and 2.40.11
Comment 3 mik@gmx.org 2016-01-12 21:06:46 UTC
*** Bug 757484 has been marked as a duplicate of this bug. ***
Comment 4 mik@gmx.org 2016-01-12 21:06:57 UTC
*** Bug 756340 has been marked as a duplicate of this bug. ***
Comment 5 mik@gmx.org 2016-02-27 12:56:13 UTC
I think this patch should be applied and a new bug opened for investigation of possible side effects.
Comment 6 Pacho Ramos 2016-02-28 11:27:03 UTC
@upstream, do you think the patch is ok to be applied? :/
Comment 7 André Klapper 2016-03-08 19:14:51 UTC
Federico: Any chance / time to take a look at this?
Comment 8 Pacho Ramos 2016-03-28 11:23:46 UTC
Any updates on this? (for at least knowing if it's safe to apply the suggested patch downstream)

Thanks
Comment 9 mik@gmx.org 2016-04-02 13:05:50 UTC
Created attachment 325219 [details] [review]
Fix bug 760262 2.40.11 regression: CLI parameter for zoom

This patch fixes bug 760262 2.40.11 regression: CLI parameter for zoom just increases image frame but not the image.

Reason for this issue is an API call marked as deprecated that has been removed in release 2.40.11.

As an alternate implementation with a call to cairo_scale() has been added.

Additionally a special script has been added that provides measures to automate CLI testing.
Comment 10 Federico Mena Quintero 2016-04-04 18:26:19 UTC
Good catch - sorry for breaking rsvg-convert like that.

I've pushed your fix with some stylistic fixes as commit 7db196eae60cc0dbbe3a262429bfecac3936c5b9; it should appear in 2.40.16.

I haven't pushed the script for automated tests as *they* are what need to happen when you run "make check".  Our testing infrastructure is built upon that, and the script as it is

  1. generates some tests and reference images

  2. runs "make check" on its own

I think it's possible to put a tweaked version of your script as part of the "make test_programs" target in the tests/ directory.  Menner, would you have a little time to play with that?
Comment 11 mik@gmx.org 2016-04-04 19:01:05 UTC
@Federico:

I've already tried to implement cleaner solutions. Till now I've faild due to limited knowledge about autotools. I haven't found any real Forum to ask questions about this. Testing is difficult to figure out.

Where can I ask an expert about autotools?

Yet I think most of the rsvg_convert_XXXX variables are overdone. Maybe the simple approach from test/Makefile.am is enough. So I can compile a rsvg-convert for testing.
https://git.gnome.org/browse/librsvg/tree/Makefile.am
https://git.gnome.org/browse/librsvg/tree/tests/Makefile.am

Comming weekend I have some time left for more trail and error ;)
Comment 12 mik@gmx.org 2016-04-08 08:07:44 UTC
Created attachment 325573 [details] [review]
Provide measures for CLI testing

Additionally a special script has been added that provides measures to automate CLI testing.

It is called during "make check" and test a bunch of CLI parameter. For this purpose it also builds "rsvg-convert".

With this changes also INCLUDES has been replaced by CFLAGS in Makefile.am
Comment 13 mik@gmx.org 2016-06-04 08:01:10 UTC
Created attachment 329110 [details] [review]
Patch providing measures for CLI testing and more
Comment 14 mik@gmx.org 2016-06-05 10:22:00 UTC
Created attachment 329149 [details] [review]
Provide measures for CLI testing and more

Provide measures for CLI testing and more

A special script has been added that provides measures to automate CLI testing.

It is called during "make check" and tests a bunch of CLI parameters.

To simplify updating false positive "make check" results the script "refresh_reftests.sh" has been created.

With this changes also INCLUDES has been replaced by CFLAGS in Makefile.am