Merge lp:~schwann/qtubuntu-camera/qtcamera-no-thumbnails into lp:qtubuntu-camera

Proposed by Günter Schwann
Status: Merged
Approved by: Ugo Riboni
Approved revision: 57
Merged at revision: 57
Proposed branch: lp:~schwann/qtubuntu-camera/qtcamera-no-thumbnails
Merge into: lp:qtubuntu-camera
Diff against target: 80 lines (+0/-48)
2 files modified
src/aalimagecapturecontrol.cpp (+0/-46)
src/aalimagecapturecontrol.h (+0/-2)
To merge this branch: bzr merge lp:~schwann/qtubuntu-camera/qtcamera-no-thumbnails
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+171024@code.launchpad.net

Commit message

Remove unused thumbnail generation

Description of the change

Remove unused thumbnail generation

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ugo Riboni (uriboni) wrote :

Dead code removal, seems sensible

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/aalimagecapturecontrol.cpp'
2--- src/aalimagecapturecontrol.cpp 2013-06-18 12:14:43 +0000
3+++ src/aalimagecapturecontrol.cpp 2013-06-24 07:02:52 +0000
4@@ -34,13 +34,6 @@
5
6 #include <ubuntu/application/ui/display.h>
7
8-const int PREVIEW_WIDTH_MAX = 360;
9-const int PREVIEW_HEIGHT_MAX = 360;
10-const int PREVIEW_QUALITY = 70;
11-const char* PREVIEW_FILE_FORMAT = "JPEG";
12-const QLatin1String PREVIEW_FILE_EXT = QLatin1String("JPG");
13-const QLatin1String PREVIEW_DIR = QLatin1String(".thumbs");
14-
15 AalImageCaptureControl::AalImageCaptureControl(AalCameraService *service, QObject *parent)
16 : QCameraImageCaptureControl(parent),
17 m_service(service),
18@@ -267,10 +260,6 @@
19 return;
20 }
21
22-// disabled, as it curently can't hande the case, when android uses the exif data for the rotation
23-// if (imageIsInGallery(m_pendingCaptureFile))
24-// saveThumbnail((const uchar*)data, dataSize);
25-
26 QFile finalFile(file.fileName());
27 bool ok = finalFile.rename(m_pendingCaptureFile);
28 if (!ok) {
29@@ -287,38 +276,3 @@
30 android_camera_start_preview(m_service->androidControl());
31 m_service->updateCaptureReady();
32 }
33-
34-bool AalImageCaptureControl::imageIsInGallery(const QString &fileName) const
35-{
36- QFileInfo fi(fileName);
37- return fi.absolutePath() == m_galleryPath;
38-}
39-
40-bool AalImageCaptureControl::saveThumbnail(const uchar *data, int dataSize)
41-{
42- QString thumbnailDir = m_galleryPath + "/" + PREVIEW_DIR;
43- QDir tdir(thumbnailDir);
44- if (!tdir.exists()) {
45- tdir.mkpath(thumbnailDir);
46- if (!tdir.exists()) {
47- qWarning() << "Can't create directory for the gallery thumbnail " << thumbnailDir;
48- return false;
49- }
50- }
51-
52- QImage fullsized;
53- fullsized.loadFromData(data, dataSize);
54- if (fullsized.isNull()) {
55- qWarning() << "Can't load the full sized image for thumbnail generation";
56- return false;
57- }
58-
59- QImage scaled = (fullsized.height() > fullsized.width())
60- ? fullsized.scaledToWidth(PREVIEW_WIDTH_MAX, Qt::SmoothTransformation)
61- : fullsized.scaledToHeight(PREVIEW_HEIGHT_MAX, Qt::SmoothTransformation);
62-
63- QFileInfo fi(m_pendingCaptureFile);
64- QString thumbnailName = thumbnailDir + "/" + fi.completeBaseName() + "_th." + PREVIEW_FILE_EXT;
65-
66- return scaled.save(thumbnailName, PREVIEW_FILE_FORMAT, PREVIEW_QUALITY);
67-}
68
69=== modified file 'src/aalimagecapturecontrol.h'
70--- src/aalimagecapturecontrol.h 2013-03-12 16:17:37 +0000
71+++ src/aalimagecapturecontrol.h 2013-06-24 07:02:52 +0000
72@@ -66,8 +66,6 @@
73 float getScreenAspectRatio();
74 void getPriorityAspectRatios();
75 void saveJpeg(void* data, uint32_t dataSize);
76- bool imageIsInGallery(const QString &fileName) const;
77- bool saveThumbnail(const uchar *data, int dataSize);
78
79 AalCameraService *m_service;
80 AalCameraControl *m_cameraControl;

Subscribers

People subscribed via source and target branches