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 586327 - gfile mime_type detection is broken
gfile mime_type detection is broken
Status: RESOLVED INVALID
Product: gthumb
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks: 583464 585760
 
 
Reported: 2009-06-19 00:18 UTC by Michael Chudobiak
Modified: 2009-06-19 00:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Chudobiak 2009-06-19 00:18:55 UTC
In get_file_mime_type:


        result = gfile_get_mime_type (file, fast_file_type);
...
        if (result == NULL) {
                char *value;
                value = g_content_type_guess (path, NULL, 0, NULL);
                result = get_static_string (value);
                g_free (value);
        }

g_content_type_guess does not return a mime_type - you need g_content_type_get_mime_type for that. Plus, this should be in gfile_get_mime_type, not the get_file_mime_type wrapper.

Extra wrinkle - some functions return const char*, some return char*.

- Mike
Comment 1 Michael Chudobiak 2009-06-19 00:45:22 UTC
Whoops, never mind - I was reading the source code of the Windows version of g_content_type_guess, not th linux version.

- Mike