[Digikam-devel] [Bug 123742] preview-pictures seem to be handled differently by Digikam and Konqueror
Gilles Caulier
caulier.gilles at free.fr
Sat May 27 11:49:39 BST 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=123742
------- Additional Comments From caulier.gilles free fr 2006-05-27 12:49 -------
SVN commit 545328 by cgilles:
digikam from trunk: always use thumbnails generated by digiKam kio slave, not kde thumbnails generator.
CCBUGS: 119946, 123742
M +10 -6 digikamthumbnail.cpp
--- trunk/extragear/graphics/digikam/kioslave/digikamthumbnail.cpp #545327:545328
@ -22,6 +22,7 @
#define XMD_H
#define PNG_BYTES_TO_CHECK 4
+#define DigiKamFingerPrint "Digikam Thumbnail Generator"
// C++ includes.
@ -273,9 +274,8 @
}
int sizeOfUint = sizeof(unsigned int);
- for (i = 0; i < h; i++)
- lines[i] = ((unsigned char *)(qimage.bits())) +
- (i * w * sizeOfUint);
+ for (i = 0 ; i < h ; i++)
+ lines[i] = ((unsigned char *)(qimage.bits())) + (i * w * sizeOfUint);
png_read_image(png_ptr, lines);
free(lines);
@ -341,10 +341,14 @
return;
}
+ // NOTE: if thumbnail have not been generated by digiKam (konqueror for example),
+ // force to recompute it, else we use it.
+
img = loadPNG(thumbPath);
if (!img.isNull())
{
- if (img.text("Thumb::MTime") == QString::number(st.st_mtime))
+ if (img.text("Thumb::MTime") == QString::number(st.st_mtime) &&
+ img.text("Software") == QString(DigiKamFingerPrint))
regenerate = false;
}
@ -387,9 +391,9 @
if (exif)
exifRotate(url.path(), img);
- img.setText(QString("Thumb::URI").latin1(), 0, uri);
+ img.setText(QString("Thumb::URI").latin1(), 0, uri);
img.setText(QString("Thumb::MTime").latin1(), 0, QString::number(st.st_mtime));
- img.setText(QString("Software").latin1(), 0, QString("Digikam Thumbnail Generator"));
+ img.setText(QString("Software").latin1(), 0, QString(DigiKamFingerPrint));
KTempFile temp(thumbPath + "-digikam-", ".png");
if (temp.status() == 0)
More information about the Digikam-devel
mailing list