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 397621 - io-png.c: Don't load iconv for ASCII text chunks
io-png.c: Don't load iconv for ASCII text chunks
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-01-17 13:32 UTC by Michael Natterer
Modified: 2010-07-10 04:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing the above (taken from maemo-gtk) (1.86 KB, patch)
2007-01-17 13:33 UTC, Michael Natterer
committed Details | Review

Description Michael Natterer 2007-01-17 13:32:32 UTC
Attached patch optimizes away g_convert() calls when the text
in question is pure ASCII.
Comment 1 Michael Natterer 2007-01-17 13:33:54 UTC
Created attachment 80504 [details] [review]
Patch implementing the above (taken from maemo-gtk)

The patch also adds a missing g_set_error() in another function, I was
too lazy to make a separate patch for that.
Comment 2 Matthias Clasen 2007-01-17 13:36:31 UTC
Looks fine. Will this really avoid loading iconv for the startup of a typical application though ? I'm sure there are other places...
Comment 3 Michael Natterer 2007-01-17 13:47:58 UTC
It probably doesn't avoid loading iconv for a "typical" app, but it doesn't
hurt to optimize it away. With the old code *any* tiny program that loads
a PNG would pull in iconv.
Comment 4 Michael Natterer 2007-01-17 14:14:48 UTC
Fixed in trunk and 2-10:

2007-01-17  Michael Natterer  <mitch@imendio.com>

	Patch taken from maemo-gtk:

	* io-png.c (png_text_to_pixbuf_option): don't call g_convert() on
	ASCII strings.

	(png_info_callback): set an error when the size_func would scale
	the pixbuf away completely.
Comment 5 Tommi Komulainen 2007-01-18 18:25:21 UTC
(In reply to comment #2)
> Looks fine. Will this really avoid loading iconv for the startup of a typical
> application though ? I'm sure there are other places...

For the record, this and not setting legacy ICCCM window manager hints avoids loading iconv on n800 running browser and xterm; grep iconv /proc/*/maps comes up empty.
Comment 6 Behdad Esfahbod 2007-01-18 18:53:14 UTC
(In reply to comment #5)
> For the record, this and not setting legacy ICCCM window manager hints avoids
> loading iconv on n800 running browser and xterm; grep iconv /proc/*/maps comes
> up empty.

If you are using glibc, that grep will always be empty, since iconv is in glibc.  You can grep for gconv.
Comment 7 Tommi Komulainen 2007-01-18 19:56:16 UTC
grep gconv only shows gconv-modules.cache