tracker r2839 - in trunk: . data/services src/tracker-extract tests/tracker-extract tests/tracker-extract/data/jpeg tests/tracker-extract/data/tiff
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2839 - in trunk: . data/services src/tracker-extract tests/tracker-extract tests/tracker-extract/data/jpeg tests/tracker-extract/data/tiff
- Date: Mon, 26 Jan 2009 21:40:25 +0000 (UTC)
Author: mottela
Date: Mon Jan 26 21:40:25 2009
New Revision: 2839
URL: http://svn.gnome.org/viewvc/tracker?rev=2839&view=rev
Log:
Changed orientation of images to an integer, updated extractors and added testcases
Added:
trunk/tests/tracker-extract/data/jpeg/exif_orientation_2.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_3.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_4.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_5.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_6.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_7.data
trunk/tests/tracker-extract/data/jpeg/exif_orientation_8.data
trunk/tests/tracker-extract/data/tiff/
trunk/tests/tracker-extract/data/tiff/basic_size_1.data
trunk/tests/tracker-extract/data/tiff/basic_size_2.data
trunk/tests/tracker-extract/data/tiff/basic_size_3.data
trunk/tests/tracker-extract/data/tiff/basic_size_4.data
trunk/tests/tracker-extract/data/tiff/basic_size_5.data
trunk/tests/tracker-extract/data/tiff/create_tiff_testdata (contents, props changed)
trunk/tests/tracker-extract/data/tiff/exif_orientation_1.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_2.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_3.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_4.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_5.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_6.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_7.data
trunk/tests/tracker-extract/data/tiff/exif_orientation_8.data
trunk/tests/tracker-extract/data/tiff/exif_size_1.data
trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.c
trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.h
trunk/tests/tracker-extract/tracker-extract-tiff-test.c
Modified:
trunk/ChangeLog
trunk/data/services/default.service
trunk/data/services/image.metadata
trunk/src/tracker-extract/tracker-extract-jpeg.c
trunk/src/tracker-extract/tracker-xmp.c
trunk/tests/tracker-extract/Makefile.am
trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata
trunk/tests/tracker-extract/tracker-extract-jpeg-test.c
trunk/tests/tracker-extract/tracker-extract-testsuite-jpeg.c
Modified: trunk/data/services/default.service
==============================================================================
--- trunk/data/services/default.service (original)
+++ trunk/data/services/default.service Mon Jan 26 21:40:25 2009
@@ -79,7 +79,7 @@
KeyMetadata8=Image:Country
KeyMetadata9=Image:City
KeyMetadata10=Image:Location
-KeyMetadata11=DC:Subject
+KeyMetadata11=Image:Orientation
TabularMetadata=File:Name;Image:Height;Image:Width;Image:Date;File:Modified;Image:Creator;Image:Software;
TileMetadata=Image:Title;Image:Height;Image:Width;Image:Date;Image:Creator;Image:Software;Image:Comments;
Mimes=application/vnd.oasis.opendocument.image;application/x-krita;
Modified: trunk/data/services/image.metadata
==============================================================================
--- trunk/data/services/image.metadata (original)
+++ trunk/data/services/image.metadata Mon Jan 26 21:40:25 2009
@@ -81,8 +81,8 @@
[Image:Orientation]
DisplayName=Orientation
-Description=The Orientation mode of the image (portrait/landscape)
-DataType=string
+Description=The Orientation mode of the image (portrait/landscape, using exif enumeration)
+DataType=integer
[Image:ExposureProgram]
DisplayName=Exposure program
Modified: trunk/src/tracker-extract/tracker-extract-jpeg.c
==============================================================================
--- trunk/src/tracker-extract/tracker-extract-jpeg.c (original)
+++ trunk/src/tracker-extract/tracker-extract-jpeg.c Mon Jan 26 21:40:25 2009
@@ -76,6 +76,7 @@
static gchar *fix_flash (const gchar *flash);
static gchar *fix_fnumber (const gchar *fn);
static gchar *fix_exposure_time (const gchar *et);
+static gchar *fix_orientation (const gchar *orientation);
static TagType tags[] = {
{ EXIF_TAG_PIXEL_Y_DIMENSION, "Image:Height", NULL },
@@ -92,7 +93,7 @@
{ EXIF_TAG_SOFTWARE, "Image:Software", NULL },
{ EXIF_TAG_MAKE, "Image:CameraMake", NULL },
{ EXIF_TAG_MODEL, "Image:CameraModel", NULL },
- { EXIF_TAG_ORIENTATION, "Image:Orientation", NULL },
+ { EXIF_TAG_ORIENTATION, "Image:Orientation", fix_orientation },
{ EXIF_TAG_EXPOSURE_PROGRAM, "Image:ExposureProgram", NULL },
{ EXIF_TAG_EXPOSURE_TIME, "Image:ExposureTime", fix_exposure_time },
{ EXIF_TAG_FNUMBER, "Image:FNumber", fix_fnumber },
@@ -176,6 +177,32 @@
return g_strdup (et);
}
+static gchar *
+fix_orientation (const gchar *orientation)
+{
+ guint i;
+ static gchar *ostr[8] = {
+ "top - left",
+ "top - right",
+ "bottom - right",
+ "bottom - left",
+ "left - top",
+ "right - top",
+ "right - bottom",
+ "left - bottom"
+ };
+
+ for (i=0;i<8;i++) {
+ if (strcmp(orientation,ostr[i])==0) {
+ gchar buffer[2];
+ snprintf (buffer,2,"%d", i+1);
+ return g_strdup(buffer);
+ }
+ }
+
+ return g_strdup("1"); /* We take this as default */
+}
+
static void
read_exif (const unsigned char *buffer,
size_t len,
Modified: trunk/src/tracker-extract/tracker-xmp.c
==============================================================================
--- trunk/src/tracker-extract/tracker-xmp.c (original)
+++ trunk/src/tracker-extract/tracker-xmp.c Mon Jan 26 21:40:25 2009
@@ -85,34 +85,6 @@
}
}
-static gchar *
-fix_orientation (const gchar *orientation)
-{
- gint value;
- value = atoi(orientation);
-
- switch (value) {
- case 1:
- return "top - left";
- case 2:
- return "top - right";
- case 3:
- return "bottom - right";
- case 4:
- return "bottom - left";
- case 5:
- return "left - top";
- case 6:
- return "right - top";
- case 7:
- return "right - bottom";
- case 8:
- return "left - bottom";
- }
-
- return "top - left";
-}
-
static void tracker_xmp_iter (XmpPtr xmp,
XmpIteratorPtr iter,
GHashTable *metadata,
@@ -351,7 +323,7 @@
else if (strcmp (name, "Orientation") == 0) {
tracker_append_string_to_hash_table (metadata,
"Image:Orientation",
- fix_orientation(value),
+ value,
append, FALSE);
}
else if (strcmp (name, "Flash") == 0) {
Modified: trunk/tests/tracker-extract/Makefile.am
==============================================================================
--- trunk/tests/tracker-extract/Makefile.am (original)
+++ trunk/tests/tracker-extract/Makefile.am Mon Jan 26 21:40:25 2009
@@ -15,6 +15,11 @@
test-tracker-extract-jpeg
endif
+if HAVE_LIBTIFF
+TEST_PROGS += \
+ test-tracker-extract-tiff
+endif
+
INCLUDES = \
-DG_LOG_DOMAIN=\"Tracker\" \
-DTEST_DATA_DIR=\""$(abs_top_builddir)/tests/tracker-extract/data"\"\
@@ -35,7 +40,9 @@
tracker-extract-testsuite-mp3.c \
tracker-extract-testsuite-mp3.h \
tracker-extract-testsuite-jpeg.c \
- tracker-extract-testsuite-jpeg.h
+ tracker-extract-testsuite-jpeg.h \
+ tracker-extract-testsuite-tiff.c \
+ tracker-extract-testsuite-tiff.h
test_tracker_extract_mp3_SOURCES = \
tracker-extract-mp3-test.c \
@@ -74,3 +81,16 @@
$(LIBJPEG_LIBS) \
$(LIBEXIF_LIBS) \
$(EXEMPI_LIBS)
+
+test_tracker_extract_tiff_SOURCES = \
+ tracker-extract-tiff-test.c \
+ $(TEST_UTILS_SOURCES)
+
+test_tracker_extract_tiff_LDADD = \
+ $(top_builddir)/src/tracker-extract/libextract-tiff.la \
+ $(top_builddir)/src/libtracker-common/libtracker-common.la \
+ $(GMODULE_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GLIB2_LIBS) \
+ $(LIBTIFF_LIBS) \
+ $(EXEMPI_LIBS)
Modified: trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata
==============================================================================
--- trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata (original)
+++ trunk/tests/tracker-extract/data/jpeg/create_jpeg_testdata Mon Jan 26 21:40:25 2009
@@ -3,11 +3,11 @@
# Basic properties
#size
-convert -size 320x240 pattern:checkerboard header_size_1.jpg
-convert -size 640x480 pattern:checkerboard header_size_2.jpg
-convert -size 1280x1024 pattern:checkerboard header_size_3.jpg
-convert -size 1600x1400 pattern:checkerboard header_size_4.jpg
-convert -size 11x2483 pattern:checkerboard header_size_5.jpg
+convert -size 320x240 pattern:checkerboard basic_size_1.jpg
+convert -size 640x480 pattern:checkerboard basic_size_2.jpg
+convert -size 1280x1024 pattern:checkerboard basic_size_3.jpg
+convert -size 1600x1400 pattern:checkerboard basic_size_4.jpg
+convert -size 11x2483 pattern:checkerboard basic_size_5.jpg
#EXIF
convert -size 320x240 pattern:checkerboard exif_size_1.jpg
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_2.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_2.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "2"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_3.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_3.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "3"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_4.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_4.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "4"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_5.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_5.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "5"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_6.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_6.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "6"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_7.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_7.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "7"
Added: trunk/tests/tracker-extract/data/jpeg/exif_orientation_8.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/jpeg/exif_orientation_8.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "8"
Added: trunk/tests/tracker-extract/data/tiff/basic_size_1.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/basic_size_1.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "320"
+Image:Height = "240"
Added: trunk/tests/tracker-extract/data/tiff/basic_size_2.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/basic_size_2.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "640"
+Image:Height = "480"
Added: trunk/tests/tracker-extract/data/tiff/basic_size_3.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/basic_size_3.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "1280"
+Image:Height = "1024"
Added: trunk/tests/tracker-extract/data/tiff/basic_size_4.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/basic_size_4.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "1600"
+Image:Height = "1400"
Added: trunk/tests/tracker-extract/data/tiff/basic_size_5.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/basic_size_5.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "11"
+Image:Height = "2483"
Added: trunk/tests/tracker-extract/data/tiff/create_tiff_testdata
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/create_tiff_testdata Mon Jan 26 21:40:25 2009
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Basic properties
+
+#size
+convert -size 320x240 pattern:checkerboard basic_size_1.tif
+convert -size 640x480 pattern:checkerboard basic_size_2.tif
+convert -size 1280x1024 pattern:checkerboard basic_size_3.tif
+convert -size 1600x1400 pattern:checkerboard basic_size_4.tif
+convert -size 11x2483 pattern:checkerboard basic_size_5.tif
+
+#EXIF
+#convert -size 320x240 pattern:checkerboard exif_size_1.tif
+#exiftool -exif:ImageWidth=640 -exif:ImageHeight=480 exif_size_1.tif
+
+#orientation
+convert -size 320x240 pattern:checkerboard exif_orientation_1.tif
+exiftool -exif:Orientation=1 -n exif_orientation_1.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_2.tif
+exiftool -exif:Orientation=2 -n exif_orientation_2.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_3.tif
+exiftool -exif:Orientation=3 -n exif_orientation_3.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_4.tif
+exiftool -exif:Orientation=4 -n exif_orientation_4.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_5.tif
+exiftool -exif:Orientation=5 -n exif_orientation_5.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_6.tif
+exiftool -exif:Orientation=6 -n exif_orientation_6.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_7.tif
+exiftool -exif:Orientation=7 -n exif_orientation_7.tif
+
+convert -size 320x240 pattern:checkerboard exif_orientation_8.tif
+exiftool -exif:Orientation=8 -n exif_orientation_8.tif
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_1.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_1.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "1"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_2.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_2.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "2"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_3.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_3.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "3"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_4.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_4.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "4"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_5.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_5.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "5"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_6.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_6.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "6"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_7.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_7.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "7"
Added: trunk/tests/tracker-extract/data/tiff/exif_orientation_8.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_orientation_8.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1 @@
+Image:Orientation = "8"
Added: trunk/tests/tracker-extract/data/tiff/exif_size_1.data
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/data/tiff/exif_size_1.data Mon Jan 26 21:40:25 2009
@@ -0,0 +1,2 @@
+Image:Width = "320"
+Image:Height = "240"
Modified: trunk/tests/tracker-extract/tracker-extract-jpeg-test.c
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-jpeg-test.c (original)
+++ trunk/tests/tracker-extract/tracker-extract-jpeg-test.c Mon Jan 26 21:40:25 2009
@@ -44,7 +44,7 @@
g_test_add_func ("/tracker-extract/tracker-extract-jpeg/check-extractor-data",
test_tracker_extract_check_extractor_data);
-#if 0
+#if 1
data = tracker_test_extract_get_extractor ("image/jpeg");
g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/basic_size",
@@ -53,8 +53,8 @@
g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/exif_size",
data, test_tracker_extract_jpeg_exif_size);
-/* g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/exif_orientation", */
-/* data, test_tracker_extract_jpeg_exif_orientation); */
+ g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/exif_orientation",
+ data, test_tracker_extract_jpeg_exif_orientation);
g_test_add_data_func ("/tracker-extract/tracker-extract-jpeg/exif_flash",
data, test_tracker_extract_jpeg_exif_flash);
Modified: trunk/tests/tracker-extract/tracker-extract-testsuite-jpeg.c
==============================================================================
--- trunk/tests/tracker-extract/tracker-extract-testsuite-jpeg.c (original)
+++ trunk/tests/tracker-extract/tracker-extract-testsuite-jpeg.c Mon Jan 26 21:40:25 2009
@@ -45,6 +45,13 @@
static const ExtractData data_exif_orientation[] = {
{ "/jpeg/exif_orientation_1.jpg", "/jpeg/exif_orientation_1.data" },
+ { "/jpeg/exif_orientation_2.jpg", "/jpeg/exif_orientation_2.data" },
+ { "/jpeg/exif_orientation_3.jpg", "/jpeg/exif_orientation_3.data" },
+ { "/jpeg/exif_orientation_4.jpg", "/jpeg/exif_orientation_4.data" },
+ { "/jpeg/exif_orientation_5.jpg", "/jpeg/exif_orientation_5.data" },
+ { "/jpeg/exif_orientation_6.jpg", "/jpeg/exif_orientation_6.data" },
+ { "/jpeg/exif_orientation_7.jpg", "/jpeg/exif_orientation_7.data" },
+ { "/jpeg/exif_orientation_8.jpg", "/jpeg/exif_orientation_8.data" },
{ NULL, NULL }
};
@@ -94,6 +101,11 @@
{ NULL, NULL }
};
+static const ExtractData data_xmp_dc[] = {
+ { "/jpeg/exif_metering_1.jpg", "/jpeg/exif_metering_1.data" },
+ { NULL, NULL }
+};
+
void test_tracker_extract_jpeg_basic_size(gconstpointer data)
{
const TrackerExtractorData *extractor = data;
Added: trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.c
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.c Mon Jan 26 21:40:25 2009
@@ -0,0 +1,92 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia (urho konttori nokia com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+
+#include "tracker-extract-test-utils.h"
+
+typedef struct {
+ gchar *filename;
+ gchar *testdata;
+} ExtractData;
+
+static const ExtractData data_basic_size[] = {
+ { "/tiff/basic_size_1.tif", "/tiff/basic_size_1.data" },
+ { "/tiff/basic_size_2.tif", "/tiff/basic_size_2.data" },
+ { "/tiff/basic_size_3.tif", "/tiff/basic_size_3.data" },
+ { "/tiff/basic_size_4.tif", "/tiff/basic_size_4.data" },
+ { "/tiff/basic_size_5.tif", "/tiff/basic_size_5.data" },
+ { NULL, NULL }
+};
+
+static const ExtractData data_exif_size[] = {
+ { "/tiff/exif_size_1.tif", "/tiff/exif_size_1.data" },
+ { NULL, NULL }
+};
+
+static const ExtractData data_exif_orientation[] = {
+ { "/tiff/exif_orientation_1.tif", "/tiff/exif_orientation_1.data" },
+ { "/tiff/exif_orientation_2.tif", "/tiff/exif_orientation_2.data" },
+ { "/tiff/exif_orientation_3.tif", "/tiff/exif_orientation_3.data" },
+ { "/tiff/exif_orientation_4.tif", "/tiff/exif_orientation_4.data" },
+ { "/tiff/exif_orientation_5.tif", "/tiff/exif_orientation_5.data" },
+ { "/tiff/exif_orientation_6.tif", "/tiff/exif_orientation_6.data" },
+ { "/tiff/exif_orientation_7.tif", "/tiff/exif_orientation_7.data" },
+ { "/tiff/exif_orientation_8.tif", "/tiff/exif_orientation_8.data" },
+ { NULL, NULL }
+};
+
+void test_tracker_extract_tiff_basic_size(gconstpointer data)
+{
+ const TrackerExtractorData *extractor = data;
+ guint i;
+
+ for (i=0; data_basic_size[i].filename; i++) {
+ extract_file (data,
+ data_basic_size[i].filename,
+ data_basic_size[i].testdata);
+ }
+}
+
+void test_tracker_extract_tiff_exif_size(gconstpointer data)
+{
+ const TrackerExtractorData *extractor = data;
+ guint i;
+
+ for (i=0; data_exif_size[i].filename; i++) {
+ g_debug ("Filename: %s", data_basic_size[i].filename);
+
+ extract_file (data,
+ data_exif_size[i].filename,
+ data_exif_size[i].testdata);
+ }
+}
+
+void test_tracker_extract_tiff_exif_orientation(gconstpointer data)
+{
+ const TrackerExtractorData *extractor = data;
+ guint i;
+
+ for (i=0; data_exif_orientation[i].filename; i++) {
+ extract_file (data,
+ data_exif_orientation[i].filename,
+ data_exif_orientation[i].testdata);
+ }
+}
Added: trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.h
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/tracker-extract-testsuite-tiff.h Mon Jan 26 21:40:25 2009
@@ -0,0 +1,30 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009, Nokia (urho konttori nokia com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TRACKER_EXTRACT_TESTSUITE_TIFF_H__
+#define __TRACKER_EXTRACT_TESTSUITE_TIFF_H__
+
+#include <tracker-extract/tracker-extract.h>
+
+void test_tracker_extract_tiff_basic_size (gconstpointer data);
+void test_tracker_extract_tiff_exif_size (gconstpointer data);
+void test_tracker_extract_tiff_exif_orientation (gconstpointer data);
+
+#endif
Added: trunk/tests/tracker-extract/tracker-extract-tiff-test.c
==============================================================================
--- (empty file)
+++ trunk/tests/tracker-extract/tracker-extract-tiff-test.c Mon Jan 26 21:40:25 2009
@@ -0,0 +1,69 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia (urho konttori nokia com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <string.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <glib.h>
+
+#include <tracker-extract/tracker-extract.h>
+
+#include "tracker-extract-test-utils.h"
+#include "tracker-extract-testsuite-generic.h"
+#include "tracker-extract-testsuite-tiff.h"
+
+int
+main (int argc, char **argv) {
+
+ gint result;
+
+ g_type_init ();
+ g_thread_init (NULL);
+ g_test_init (&argc, &argv, NULL);
+
+ TrackerExtractorData *data;
+
+ g_test_message ("Testing extractor functionality");
+ g_test_add_func ("/tracker-extract/tracker-extract-tiff/check-extractor-data",
+ test_tracker_extract_check_extractor_data);
+
+#if 1
+ data = tracker_test_extract_get_extractor ("image/tiff");
+
+ g_test_add_data_func ("/tracker-extract/tracker-extract-tiff/basic_size",
+ data, test_tracker_extract_tiff_basic_size);
+
+/* g_test_add_data_func ("/tracker-extract/tracker-extract-tiff/exif_size", */
+/* data, test_tracker_extract_tiff_exif_size); */
+
+ g_test_add_data_func ("/tracker-extract/tracker-extract-tiff/exif_orientation",
+ data, test_tracker_extract_tiff_exif_orientation);
+
+ if (g_test_perf()) {
+
+ }
+
+#endif
+
+
+ result = g_test_run ();
+
+ return result;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]