Mercurial > pidgin
comparison src/gtkimhtml.c @ 6162:7e967f2d6721
[gaim-migrate @ 6642]
My bad
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Thu, 17 Jul 2003 01:20:34 +0000 |
| parents | 16fd7811effd |
| children | 338147ea6896 |
comparison
equal
deleted
inserted
replaced
| 6161:dbe56164696f | 6162:7e967f2d6721 |
|---|---|
| 1566 GtkIMHtmlImage *image = g_object_get_data(G_OBJECT(sel), "GtkIMHtmlImage"); | 1566 GtkIMHtmlImage *image = g_object_get_data(G_OBJECT(sel), "GtkIMHtmlImage"); |
| 1567 gchar *type = NULL; | 1567 gchar *type = NULL; |
| 1568 GError *error = NULL; | 1568 GError *error = NULL; |
| 1569 #if GTK_CHECK_VERSION(2,2,0) | 1569 #if GTK_CHECK_VERSION(2,2,0) |
| 1570 GSList *formats = gdk_pixbuf_get_formats(); | 1570 GSList *formats = gdk_pixbuf_get_formats(); |
| 1571 #else | |
| 1572 char *basename = g_path_get_basename(filename); | |
| 1573 char *ext = strrchr(basename, '.'); | |
| 1571 #endif | 1574 #endif |
| 1572 | 1575 |
| 1573 if (g_file_test(filename, G_FILE_TEST_IS_DIR)) { | 1576 if (g_file_test(filename, G_FILE_TEST_IS_DIR)) { |
| 1574 /* append a / if needed */ | 1577 /* append a / if needed */ |
| 1575 if (filename[strlen(filename) - 1] != '/') { | 1578 if (filename[strlen(filename) - 1] != '/') { |
| 1609 } | 1612 } |
| 1610 | 1613 |
| 1611 g_slist_free(formats); | 1614 g_slist_free(formats); |
| 1612 #else | 1615 #else |
| 1613 /* this is really ugly code, but I think it will work */ | 1616 /* this is really ugly code, but I think it will work */ |
| 1614 char *basename = g_path_get_basename(filename); | |
| 1615 char *ext = strrchr(basename, '.'); | |
| 1616 | |
| 1617 if(ext) { | 1617 if(ext) { |
| 1618 ext++; | 1618 ext++; |
| 1619 if(!g_ascii_strcasecmp(ext, "jpeg") || !g_ascii_strcasecmp(ext, "jpg")) | 1619 if(!g_ascii_strcasecmp(ext, "jpeg") || !g_ascii_strcasecmp(ext, "jpg")) |
| 1620 type = g_strdup("jpeg"); | 1620 type = g_strdup("jpeg"); |
| 1621 else if(!g_ascii_strcasecmp(ext, "png")) | 1621 else if(!g_ascii_strcasecmp(ext, "png")) |
