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 721851 - Commandline export not working for pixbuf and possibly other plugins
Commandline export not working for pixbuf and possibly other plugins
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: exports
0.97.x
Other Linux
: Normal enhancement
: 0.97.3
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-09 09:48 UTC by joerg.faschingbauer
Modified: 2014-03-08 11:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Brutal patch (1.06 KB, patch)
2014-01-10 17:08 UTC, joerg.faschingbauer
none Details | Review

Description joerg.faschingbauer 2014-01-09 09:48:20 UTC
I use dia to create PNG files like so:

$ dia --export=dest.png --filter=pixbuf-png source.dia

** (dia:22315): CRITICAL **: Can't find output format/filter pixbuf-png

Same holds true for --filter=jpg. Both filters "pixbuf-png" and "jpg" are advertised by the --help output, so I assume they ought to be functional.

When using the export menu in GUI mode, then I see both filters there and functional. No problem on that front.

Attached is a somewhat brutal patch that fixes the problem for me. dia might not be used in batch mode without an X server running though.
Comment 1 Hans Breuer 2014-01-10 07:47:52 UTC
Not seeing the patch yet, but I guess it will revert part of the fix for bug 155495 with the following comment:

2004-10-31  Hans Breuer  <hans@breuer.org>

    * plug-ins/pixbuf/pixbuf.c : when running non interactive
    Dia won't call color_init() as it assumes no display. If
    we have one as tested ourselve we can as well color_init()
    to avoid g_warnings() and produce the right collors.
    Fixes bug #155495.

Making Dia work without X server is part of the goal, so not to be dropped lightly.
IIRC the pixbuf plug-in is the only one requiring an initialized display, so you are seeing intended behavior and not a bug.
Comment 2 joerg.faschingbauer 2014-01-10 17:08:36 UTC
Created attachment 265947 [details] [review]
Brutal patch
Comment 3 joerg.faschingbauer 2014-01-10 17:18:05 UTC
Sorry about the patch, I've managed to add it now.

I agree with you, decoupling dia batch mode from a display is a good thing. However cairo PNG export somehow doesn't work here (using gentoo), and JPG is also done by pixbuf.

Is there any other option for me than to keep my own dirty private patch?
Comment 4 Hans Breuer 2014-03-02 19:13:24 UTC
Just pushed the following fix to master:
https://git.gnome.org/browse/dia/commit/?id=c3dcf1eec1b4ef57c45c58410048b77c83ea50dd

BTW: please check the cairo export again. Bug 573261 should be finally fixed. And if cairo is good enough for gtk+ it should be godd enough for Dia. If not, please report the issue in a new bug.
Comment 5 joerg.faschingbauer 2014-03-02 21:28:28 UTC
Works, thank you.
Comment 6 Hans Breuer 2014-03-08 11:19:49 UTC
cherry-picked to dia-0-97 branch
https://git.gnome.org/browse/dia/commit/?h=dia-0-97&id=276ce968d91964fcaa64f77826ad14eb4fba555f