aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/thumbnailqt_extractor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/thumbnailqt_extractor.cc')
-rw-r--r--src/plugins/thumbnailqt_extractor.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/thumbnailqt_extractor.cc b/src/plugins/thumbnailqt_extractor.cc
index 6a66981..313ebbc 100644
--- a/src/plugins/thumbnailqt_extractor.cc
+++ b/src/plugins/thumbnailqt_extractor.cc
@@ -43,6 +43,14 @@
43extern "C" 43extern "C"
44{ 44{
45 45
46
47static void
48mh (QtMsgType mtype, const char *msg)
49{
50 /* just discard */
51}
52
53
46int 54int
47EXTRACTOR_thumbnailqt_extract (const char *data, 55EXTRACTOR_thumbnailqt_extract (const char *data,
48 size_t size, 56 size_t size,
@@ -57,7 +65,9 @@ EXTRACTOR_thumbnailqt_extract (const char *data,
57 unsigned long height; 65 unsigned long height;
58 char format[64]; 66 char format[64];
59 QImage::Format colors; 67 QImage::Format colors;
68 QtMsgHandler oh;
60 69
70 oh = qInstallMsgHandler (&mh);
61 /* Determine image format to use */ 71 /* Determine image format to use */
62 if (options == NULL) 72 if (options == NULL)
63 colors = QImage::Format_Indexed8; 73 colors = QImage::Format_Indexed8;
@@ -106,6 +116,7 @@ EXTRACTOR_thumbnailqt_extract (const char *data,
106 if ( (height == 0) || (width == 0) ) 116 if ( (height == 0) || (width == 0) )
107 { 117 {
108 delete img; 118 delete img;
119 qInstallMsgHandler (oh);
109 return 0; 120 return 0;
110 } 121 }
111 snprintf(format, 122 snprintf(format,
@@ -122,6 +133,7 @@ EXTRACTOR_thumbnailqt_extract (const char *data,
122 strlen(format)+1)) 133 strlen(format)+1))
123 { 134 {
124 delete img; 135 delete img;
136 qInstallMsgHandler (oh);
125 return 1; 137 return 1;
126 } 138 }
127 /* Change color depth */ 139 /* Change color depth */
@@ -154,6 +166,7 @@ EXTRACTOR_thumbnailqt_extract (const char *data,
154 buffer.setBuffer(&bytes); 166 buffer.setBuffer(&bytes);
155 buffer.open(QIODevice::WriteOnly); 167 buffer.open(QIODevice::WriteOnly);
156 thumb.save(&buffer, "PNG"); 168 thumb.save(&buffer, "PNG");
169 qInstallMsgHandler (oh);
157 return proc (proc_cls, 170 return proc (proc_cls,
158 "thumbnailqt", 171 "thumbnailqt",
159 EXTRACTOR_METATYPE_THUMBNAIL, 172 EXTRACTOR_METATYPE_THUMBNAIL,