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

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 1303
Merged at revision: 1308
Proposed branch: lp:~artmello/gallery-app/gallery-app-fix_1536168
Merge into: lp:gallery-app
Diff against target: 27 lines (+7/-0)
2 files modified
rc/qml/MediaViewer/SingleMediaViewer.qml (+1/-0)
src/photo/photo.cpp (+6/-0)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-fix_1536168
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+291623@code.launchpad.net

Commit message

Check MimeType to verify if it's an image format before adding to gallery's collection

Description of the change

Check MimeType to verify if it's an image format before adding to gallery's collection

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

code looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rc/qml/MediaViewer/SingleMediaViewer.qml'
--- rc/qml/MediaViewer/SingleMediaViewer.qml 2016-02-25 18:01:15 +0000
+++ rc/qml/MediaViewer/SingleMediaViewer.qml 2016-04-12 12:23:56 +0000
@@ -240,6 +240,7 @@
240 horizontalAlignment: Text.AlignHCenter240 horizontalAlignment: Text.AlignHCenter
241 text: i18n.tr("An error has occurred attempting to load media")241 text: i18n.tr("An error has occurred attempting to load media")
242 fontSize: "large"242 fontSize: "large"
243 color: "lightgrey"
243 }244 }
244 }245 }
245 }246 }
246247
=== modified file 'src/photo/photo.cpp'
--- src/photo/photo.cpp 2015-11-04 19:33:54 +0000
+++ src/photo/photo.cpp 2016-04-12 12:23:56 +0000
@@ -52,6 +52,12 @@
52 */52 */
53bool Photo::isValid(const QFileInfo& file)53bool Photo::isValid(const QFileInfo& file)
54{54{
55 QMimeDatabase mimedb;
56 QMimeType mimeType = mimedb.mimeTypeForFile(file);
57 if (!mimeType.name().contains("image")) {
58 return false;
59 }
60
55 QImageReader reader(file.filePath());61 QImageReader reader(file.filePath());
56 QByteArray format = reader.format();62 QByteArray format = reader.format();
5763

Subscribers

People subscribed via source and target branches