Merge lp:~artmello/gallery-app/gallery-app-fix_show_imported_media_on_today_event into lp:gallery-app

Proposed by Arthur Mello
Status: Merged
Approved by: Bill Filler
Approved revision: 1201
Merged at revision: 1203
Proposed branch: lp:~artmello/gallery-app/gallery-app-fix_show_imported_media_on_today_event
Merge into: lp:gallery-app
Diff against target: 168 lines (+112/-2)
6 files modified
debian/rules (+3/-0)
src/config.h.in (+1/-1)
src/photoeditor/photo-metadata.cpp (+1/-1)
tests/unittests/CMakeLists.txt (+1/-0)
tests/unittests/photo-metadata/CMakeLists.txt (+60/-0)
tests/unittests/photo-metadata/tst_photo-metadata.cpp (+46/-0)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-fix_show_imported_media_on_today_event
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+258429@code.launchpad.net

Commit message

Make sure that DateTimeDigitized is the first tag evaluated to get exposure time

Description of the change

Make sure that DateTimeDigitized is the first tag evaluated to get exposure time

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1196. By Arthur Mello

Update unittest for resource since gallery handle removable sd cards

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1197. By Arthur Mello

Add new unittest to check the exposure date time

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1198. By Arthur Mello

Revert changes on resource test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1199. By Arthur Mello

Add rule to output log when test fails

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1200. By Arthur Mello

Fix wrong header in config.h.in

1201. By Arthur Mello

Fix unittest

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/rules'
2--- debian/rules 2014-09-09 08:14:03 +0000
3+++ debian/rules 2015-05-08 17:05:39 +0000
4@@ -17,3 +17,6 @@
5 # Unfortunately, the default build directory is not exposed
6 # (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601774).
7 $(MAKE) -C obj-$(DEB_HOST_GNU_TYPE) gallery-app.pot
8+
9+override_dh_auto_test:
10+ QT_QPA_PLATFORM=minimal CTEST_OUTPUT_ON_FAILURE=1 dh_auto_test
11
12=== modified file 'src/config.h.in'
13--- src/config.h.in 2014-03-15 15:29:41 +0000
14+++ src/config.h.in 2015-05-08 17:05:39 +0000
15@@ -1,7 +1,7 @@
16 /*
17 * Copyright 2013 Canonical Ltd.
18 *
19- * This file is part of webbrowser-app.
20+ * This file is part of gallery-app.
21 *
22 * webbrowser-app is free software; you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24
25=== modified file 'src/photoeditor/photo-metadata.cpp'
26--- src/photoeditor/photo-metadata.cpp 2015-02-26 20:28:06 +0000
27+++ src/photoeditor/photo-metadata.cpp 2015-05-08 17:05:39 +0000
28@@ -27,10 +27,10 @@
29 const char* EXIF_ORIENTATION_KEY = "Exif.Image.Orientation";
30 const char* EXIF_DATETIMEDIGITIZED_KEY = "Exif.Photo.DateTimeDigitized";
31 const char* EXPOSURE_TIME_KEYS[] = {
32+ "Exif.Photo.DateTimeDigitized",
33 "Exif.Photo.DateTimeOriginal",
34 "Xmp.exif.DateTimeOriginal",
35 "Xmp.xmp.CreateDate",
36- "Exif.Photo.DateTimeDigitized",
37 "Xmp.exif.DateTimeDigitized",
38 "Exif.Image.DateTime"
39 };
40
41=== modified file 'tests/unittests/CMakeLists.txt'
42--- tests/unittests/CMakeLists.txt 2015-02-20 13:39:38 +0000
43+++ tests/unittests/CMakeLists.txt 2015-05-08 17:05:39 +0000
44@@ -4,3 +4,4 @@
45 add_subdirectory(mediaobjectfactory)
46 add_subdirectory(resource)
47 add_subdirectory(video)
48+add_subdirectory(photo-metadata)
49
50=== added directory 'tests/unittests/photo-metadata'
51=== added file 'tests/unittests/photo-metadata/CMakeLists.txt'
52--- tests/unittests/photo-metadata/CMakeLists.txt 1970-01-01 00:00:00 +0000
53+++ tests/unittests/photo-metadata/CMakeLists.txt 2015-05-08 17:05:39 +0000
54@@ -0,0 +1,60 @@
55+add_definitions(-DTEST_SUITE)
56+
57+if(NOT CTEST_TESTING_TIMEOUT)
58+ set(CTEST_TESTING_TIMEOUT 60)
59+endif()
60+
61+include_directories(
62+ ${gallery_src_SOURCE_DIR}
63+ ${gallery_album_src_SOURCE_DIR}
64+ ${gallery_core_src_SOURCE_DIR}
65+ ${gallery_database_src_SOURCE_DIR}
66+ ${gallery_event_src_SOURCE_DIR}
67+ ${gallery_media_src_SOURCE_DIR}
68+ ${gallery_medialoader_src_SOURCE_DIR}
69+ ${gallery_photo_src_SOURCE_DIR}
70+ ${gallery_photoeditor_src_SOURCE_DIR}
71+ ${gallery_util_src_SOURCE_DIR}
72+ ${gallery_video_src_SOURCE_DIR}
73+ ${EXIV2_INCLUDEDIR}
74+ ${CMAKE_BINARY_DIR}
75+ )
76+
77+QT5_WRAP_CPP(PHOTOMETADATA_MOCS
78+ ${gallery_src_SOURCE_DIR}/gallery-manager.h
79+ ${gallery_database_src_SOURCE_DIR}/album-table.h
80+ ${gallery_database_src_SOURCE_DIR}/database.h
81+ ${gallery_database_src_SOURCE_DIR}/media-table.h
82+ ${gallery_medialoader_src_SOURCE_DIR}/video-metadata.h
83+ ${gallery_photo_src_SOURCE_DIR}/photo.h
84+ )
85+
86+add_definitions(-DSAMPLE_IMAGE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/images")
87+add_executable(photo-metadata
88+ tst_photo-metadata.cpp
89+ ${gallery_photoeditor_src_SOURCE_DIR}/photo-metadata.cpp
90+ ../stubs/album-table_stub.cpp
91+ ../stubs/database_stub.cpp
92+ ../stubs/media-table_stub.cpp
93+ ../stubs/photo_stub.cpp
94+ ../stubs/video_stub.cpp
95+ ../stubs/video-metadata_stub.cpp
96+ ../stubs/gallery-manager_stub.cpp
97+ ${PHOTOMETADATA_MOCS}
98+ )
99+
100+qt5_use_modules(photo-metadata Widgets Core Quick Qml Test)
101+add_test(photo-metadata photo-metadata -xunitxml -o test_video.xml)
102+set_tests_properties(photo-metadata PROPERTIES
103+ TIMEOUT ${CTEST_TESTING_TIMEOUT}
104+ ENVIRONMENT "QT_QPA_PLATFORM=minimal;TZ=Pacific/Auckland"
105+ )
106+
107+target_link_libraries(photo-metadata
108+ gallery-album
109+ gallery-core
110+ gallery-media
111+ gallery-util
112+ gallery-video
113+ ${EXIV2_LIBRARIES}
114+ )
115
116=== added directory 'tests/unittests/photo-metadata/images'
117=== added file 'tests/unittests/photo-metadata/images/sample01.jpg'
118Binary files tests/unittests/photo-metadata/images/sample01.jpg 1970-01-01 00:00:00 +0000 and tests/unittests/photo-metadata/images/sample01.jpg 2015-05-08 17:05:39 +0000 differ
119=== added file 'tests/unittests/photo-metadata/tst_photo-metadata.cpp'
120--- tests/unittests/photo-metadata/tst_photo-metadata.cpp 1970-01-01 00:00:00 +0000
121+++ tests/unittests/photo-metadata/tst_photo-metadata.cpp 2015-05-08 17:05:39 +0000
122@@ -0,0 +1,46 @@
123+/*
124+ * Copyright (C) 2015 Canonical, Ltd.
125+ *
126+ * This program is free software; you can redistribute it and/or modify
127+ * it under the terms of the GNU General Public License as published by
128+ * the Free Software Foundation; version 3.
129+ *
130+ * This program is distributed in the hope that it will be useful,
131+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
132+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
133+ * GNU General Public License for more details.
134+ *
135+ * You should have received a copy of the GNU General Public License
136+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
137+ */
138+
139+#include <QtTest/QtTest>
140+
141+#include "photoeditor/photo-metadata.h"
142+
143+class tst_PhotoMetadata : public QObject
144+{
145+ Q_OBJECT
146+
147+private slots:
148+ void exposureTime();
149+
150+private:
151+ PhotoMetadata *m_metadata;
152+};
153+
154+void tst_PhotoMetadata::exposureTime()
155+{
156+ m_metadata = PhotoMetadata::fromFile(SAMPLE_IMAGE_DIR "/sample01.jpg");
157+ // Check that the original exposure time is returned
158+ QCOMPARE(m_metadata->exposureTime(), QDateTime(QDate(2015, 5, 8), QTime(1, 51, 48)));
159+
160+ // Set DateTimeDigitized the same way gallery does for imported files
161+ m_metadata->setDateTimeDigitized(QDateTime(QDate(2015, 12, 31), QTime(23, 59, 59)));
162+ // Check that the new exposure time is returned
163+ QCOMPARE(m_metadata->exposureTime(), QDateTime(QDate(2015, 12, 31), QTime(23, 59, 59)));
164+}
165+
166+QTEST_MAIN(tst_PhotoMetadata);
167+
168+#include "tst_photo-metadata.moc"

Subscribers

People subscribed via source and target branches