Opened 7 years ago
Closed 2 years ago
#54962 closed defect (fixed)
adwaita-icon-theme 3.26.0 +quartz: Fails to install because gtk-encode-symbolic-svg cannot identify svg file type (gdk-pixbuf2 / glib2 problem)
Reported by: | fredowski | Owned by: | dbevans (David B. Evans) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.4.1 |
Keywords: | Cc: | jjstickel (Jonathan Stickel), mascguy (Christopher Nielsen) | |
Port: | adwaita-icon-theme glib2 gtk3 gdk-pixbuf2 |
Description
Hi,
i noticed a fundamental problem under quartz variant with gdk-pixbuf2 and glib2 when trying to install adwaita-icon-theme. adwaita-icon-theme fails to install because gtk-encode-symbolic-svg from the gtk3 package is called. This tool reads svg files to produces the png files in different sizes. To reproduce the problem in a simple manner, you can just call
gtk-encode-symbolic-svg <some-svg-file> 32x32
which will yield an error message that the file type is unknown. I traced down the problem which is specific to the quartz variant to quartz specific changes in the gio library. gtk-encode-symbolic-svg calls gdk_pixbuf_new_from_stream such that gdk-pixbuf needs to identify the file type from the file content. This results in calling _gdk_pixbuf_get_module:
There the function g_content_type_guess is called which will be taken from gosxcontenttype.c for the quartz build. See:
versus the X11/Unix version based on xdgmime support:
https://github.com/GNOME/glib/blob/d4a21e001a118c904ec6b57aee2838eb67e34311/gio/gcontenttype.c#L686
Without a file name this more or less reduces to choosing "public.text" type for data only guessing. I guess this is a fundamental difference to the x11 build where the xdg system is used to identify the content type. I did some short research without finding a MacOS equivalent to identify the content type from pure data as it is done in this application. From my perspective the way to go would be
a) More or less code the whole xdg mime functionality again to have the possibility to figure out the content type from analyzing the content.
b) Include xdgmime also in the Quartz version. This would require some changes in the gio library. This leaves the mime to uti conversion but at least there seems to be some MacOS support for this:
https://developer.apple.com/documentation/coreservices/1448939-uttypecreatepreferredidentifierf
Is there any specific reason not to use the xdg functionality in the Quartz build?
Change History (5)
comment:1 Changed 7 years ago by raimue (Rainer Müller)
Owner: | set to dbevans |
---|---|
Status: | new → assigned |
comment:2 follow-up: 5 Changed 7 years ago by fredowski
I have opened a ticket at gnome: https://bugzilla.gnome.org/show_bug.cgi?id=788401
comment:3 Changed 7 years ago by jjstickel (Jonathan Stickel)
Cc: | jjstickel added |
---|
comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:5 Changed 2 years ago by mascguy (Christopher Nielsen)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to fredowski:
I have opened a ticket at gnome: https://bugzilla.gnome.org/show_bug.cgi?id=788401
Reviewing the upstream ticket, it looks like this has been addressed. Closing as fixed.
As the packaging in MacPorts does not apply patches to change this behavior, this should be reported to and addressed by upstream.