[easytag] Add several picture type strings
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Add several picture type strings
- Date: Mon, 24 Nov 2014 21:47:45 +0000 (UTC)
commit b6e9d66d8a305209160706bd916f2f7282055063
Author: David King <amigadave amigadave com>
Date: Mon Nov 24 21:43:49 2014 +0000
Add several picture type strings
Improve the heuristic for guessing the image type from the filename.
https://bugzilla.gnome.org/show_bug.cgi?id=740654
src/picture.c | 19 ++++++++++++++++---
src/picture.h | 2 +-
tests/test-picture.c | 15 ++++++++++++++-
3 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/src/picture.c b/src/picture.c
index 7fd81fb..c5164fb 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -73,6 +73,8 @@ EtPictureType
et_picture_type_from_filename (const gchar *filename_utf8)
{
EtPictureType picture_type = ET_PICTURE_TYPE_FRONT_COVER;
+
+ /* TODO: Use g_str_tokenize_and_fold(). */
static const struct
{
const gchar *type_str;
@@ -81,10 +83,21 @@ et_picture_type_from_filename (const gchar *filename_utf8)
{
{ "front", ET_PICTURE_TYPE_FRONT_COVER },
{ "back", ET_PICTURE_TYPE_BACK_COVER },
+ { "inlay", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "inside", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "leaflet", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "page", ET_PICTURE_TYPE_LEAFLET_PAGE },
{ "CD", ET_PICTURE_TYPE_MEDIA },
+ { "media", ET_PICTURE_TYPE_MEDIA },
+ { "artist", ET_PICTURE_TYPE_ARTIST_PERFORMER },
+ { "performer", ET_PICTURE_TYPE_ARTIST_PERFORMER },
+ { "conductor", ET_PICTURE_TYPE_CONDUCTOR },
+ { "band", ET_PICTURE_TYPE_BAND_ORCHESTRA },
+ { "orchestra", ET_PICTURE_TYPE_BAND_ORCHESTRA },
+ { "composer", ET_PICTURE_TYPE_COMPOSER },
+ { "lyricist", ET_PICTURE_TYPE_LYRICIST_TEXT_WRITER },
{ "illustration", ET_PICTURE_TYPE_ILLUSTRATION },
- { "inside", ET_PICTURE_TYPE_LEAFLET_PAGE },
- { "inlay", ET_PICTURE_TYPE_LEAFLET_PAGE }
+ { "publisher", ET_PICTURE_TYPE_PUBLISHER_STUDIO_LOGOTYPE }
};
gsize i;
gchar *folded_filename;
@@ -230,7 +243,7 @@ Picture_Type_String (EtPictureType type)
return _("During recording");
case ET_PICTURE_TYPE_DURING_PERFORMANCE:
return _("During performance");
- case ET_PICTURE_TYPE_MOVIDE_VIDEO_SCREEN_CAPTURE:
+ case ET_PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE:
return _("Movie/video screen capture");
case ET_PICTURE_TYPE_A_BRIGHT_COLOURED_FISH:
return _("A bright colored fish");
diff --git a/src/picture.h b/src/picture.h
index 925b49d..0bc680b 100644
--- a/src/picture.h
+++ b/src/picture.h
@@ -61,7 +61,7 @@ typedef enum // Picture types
ET_PICTURE_TYPE_RECORDING_LOCATION,
ET_PICTURE_TYPE_DURING_RECORDING,
ET_PICTURE_TYPE_DURING_PERFORMANCE,
- ET_PICTURE_TYPE_MOVIDE_VIDEO_SCREEN_CAPTURE,
+ ET_PICTURE_TYPE_MOVIE_VIDEO_SCREEN_CAPTURE,
ET_PICTURE_TYPE_A_BRIGHT_COLOURED_FISH,
ET_PICTURE_TYPE_ILLUSTRATION,
ET_PICTURE_TYPE_BAND_ARTIST_LOGOTYPE,
diff --git a/tests/test-picture.c b/tests/test-picture.c
index c037c1b..a1970d1 100644
--- a/tests/test-picture.c
+++ b/tests/test-picture.c
@@ -108,7 +108,20 @@ picture_type_from_filename (void)
{ "illustrations of grandeur", ET_PICTURE_TYPE_ILLUSTRATION },
{ "inside outside", ET_PICTURE_TYPE_LEAFLET_PAGE },
{ "front to back", ET_PICTURE_TYPE_FRONT_COVER },
- { "back to front", ET_PICTURE_TYPE_FRONT_COVER }
+ { "back to front", ET_PICTURE_TYPE_FRONT_COVER },
+ { "inlay", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "leaflet", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "page", ET_PICTURE_TYPE_LEAFLET_PAGE },
+ { "multimedia", ET_PICTURE_TYPE_MEDIA },
+ { "artist band", ET_PICTURE_TYPE_ARTIST_PERFORMER },
+ { "band", ET_PICTURE_TYPE_BAND_ORCHESTRA },
+ { "orchestra", ET_PICTURE_TYPE_BAND_ORCHESTRA },
+ { "performer", ET_PICTURE_TYPE_ARTIST_PERFORMER },
+ { "composer", ET_PICTURE_TYPE_COMPOSER },
+ { "lyricist", ET_PICTURE_TYPE_LYRICIST_TEXT_WRITER },
+ { "writer", ET_PICTURE_TYPE_FRONT_COVER },
+ { "publisher", ET_PICTURE_TYPE_PUBLISHER_STUDIO_LOGOTYPE },
+ { "studio", ET_PICTURE_TYPE_FRONT_COVER }
};
for (i = 0; i < G_N_ELEMENTS (pictures); i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]