Re: [kde-linux] grumble about konqueror image gallery change
- From: James Richard Tyrer <tyrerj@xxxxxxx>
- Date: Tue, 30 Oct 2007 18:05:00 -0700
david wrote:
James Richard Tyrer wrote:I find that this isn't related to KView (which I adopted) but I lookeddavid wrote:<grumble>Could you please provide me with some more specific information?
For some reason, awhile back, the Konqueror image gallery plugin decided to give the thumbnails double file extensions (filename.jpg.jpg). When I went to report this at the kde.org bug database, I found it had already been reported and marked as WONTFIX because the developer decided for some utterly irrational reason to no longer have the plugin trim off the file extension before naming the thumb. That bug report said something about avoiding filename clashes, but the thumbnails are put into a separate thumbs folder, so there's no possible filename clash to avoid!
Anyway, when I tried to provide a comment to that effect, the kde.org bug database gave me an error and invited me to contact the webmaster with the date/time and info. Forget it. The server's already recorded the date/time and logged the error, so forget it.
</grumble>
And my wife's laptop with PCLinuxOS got GIMP 2.4 last week during update, and my laptop with Debian is still stuck with 2.2 ...
Sorry for grumbles, just needed to get it off the to do list!
Which function in this in Konqueror? Is it:
View -> View Mode -> Photobook
Tools > Create Image Gallery
What bug number is it?
http://bugs.kde.org/show_bug.cgi?id=142002
I see it's also been reported again, as a wishlist item, so I tossed five votes at it. Maybe someone will listen.
Exactly where do these double extensions show up?
They show up in the names of the generated thumbnails. Inside the folder containing the full size images, it creates a folder called thumbs. Inside that folder, it puts the generated thumbnails. So if you made an image gallery from imagefile1.jpg, it creates a file named imagefile1.jpg.jpg in the thumbs folder.
I understand their rationale, but I think it should be a configurable option.
at it anyway.
He has a point that somebody might be stupid enough to have files with
the same name and different extensions which were not different aspects
of the same data. That is if you have the same exact image stored in
two different formats, there is no problem since the thumbnails would be
the same.
However, you are correct that there shouldn't be two extensions when the
file type has only one. So, I would suggest that if we are going to use
the same format with thumbnails with matching names that the "." in the
original file should be replaced with a "_" which is a more normal practice.
This is fairly easy to fix. I don't know why he wasn't willing to do so.
--
JRT
Index: imgalleryplugin.cpp
===================================================================
--- imgalleryplugin.cpp (revision 729969)
+++ imgalleryplugin.cpp (working copy)
@@ -188,6 +188,7 @@ void KImGalleryPlugin::createBody(QTextS
int imgIndex;
QFileInfo imginfo;
QPixmap imgProp;
+ QString imgNameFormat;
for (imgIndex = 0; !m_cancelled && (imgIndex < numOfImages);) {
stream << "<tr>" << endl;
@@ -200,9 +201,8 @@ void KImGalleryPlugin::createBody(QTextS
stream << "<td align='center'>\n<a href=\"" << imgName << "\">";
}
-
- if (createThumb(imgName, sourceDirName, imgGalleryDir, imageFormat)) {
- const QString imgPath("thumbs/" + imgName + extension(imageFormat));
+ if (createThumb(imgName, imgNameFormat, sourceDirName, imgGalleryDir, imageFormat)) {
+ const QString imgPath("thumbs/" + imgNameFormat);
stream << "<img src=\"" << imgPath << "\" width=\"" << m_imgWidth << "\" ";
stream << "height=\"" << m_imgHeight << "\" alt=\"" << imgPath << "\"/>";
m_progressDlg->setLabelText( i18n("Created thumbnail for: \n%1").arg(imgName) );
@@ -420,9 +420,15 @@ void KImGalleryPlugin::loadCommentFile()
}
}
-bool KImGalleryPlugin::createThumb( const QString& imgName, const QString& sourceDirName,
- const QString& imgGalleryDir, const QString& imageFormat)
+bool KImGalleryPlugin::createThumb( const QString& imgName, QString& imgNameFormat, const QString& sourceDirName, const QString& imgGalleryDir, const QString& imageFormat)
{
+
+ int imgDot = 0;
+ QString thumbName = imgName;
+ while ( (imgDot = thumbName.find( '.', imgDot )) >= 0 ) {
+ thumbName = thumbName.replace( (uint) imgDot, 1, '_' );
+ }
+
QImage img;
const QString pixPath = sourceDirName + QString::fromLatin1("/") + imgName;
@@ -434,7 +440,7 @@ bool KImGalleryPlugin::createThumb( cons
KIO::NetAccess::copy(srcURL, destURL, static_cast<KParts::Part *>(parent())->widget());
}
- const QString imgNameFormat = imgName + extension(imageFormat);
+ imgNameFormat = thumbName + extension(imageFormat);
const QString thumbDir = imgGalleryDir + QString::fromLatin1("/thumbs/");
int extent = m_configDlg->getThumbnailSize();
Index: imgalleryplugin.h
===================================================================
--- imgalleryplugin.h (revision 729969)
+++ imgalleryplugin.h (working copy)
@@ -68,7 +68,7 @@ class KImGalleryPlugin : public KParts::
void createCSSSection(QTextStream& stream);
void createBody(QTextStream& stream, const QString& sourceDirName, const QStringList& subDirList, const QDir& imageDir, const KURL& url, const QString& imageFormat);
- bool createThumb( const QString& imgName, const QString& sourceDirName, const QString& imgGalleryDir, const QString& imageFormat);
+ bool createThumb( const QString& imgName, QString& imgNameFormat, const QString& sourceDirName, const QString& imgGalleryDir, const QString& imageFormat);
bool createHtml( const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat);
void deleteCancelledGallery( const KURL& url, const QString& sourceDirName, int recursionLevel, const QString& imageFormat);
___________________________________________________
This message is from the kde-linux mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde-linux.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.
- References:
- [kde-linux] grumble about konqueror image gallery change
- From: david
- Re: [kde-linux] grumble about konqueror image gallery change
- From: James Richard Tyrer
- [kde-linux] grumble about konqueror image gallery change
- Prev by Date: Re: [kde-linux] KDE sound screwed, one user account ONLY
- Next by Date: Re: [kde-linux] KDE 3 Beta
- Previous by thread: Re: [kde-linux] grumble about konqueror image gallery change
- Next by thread: [kde-linux] amarok dislikes mysql - at least, when you're not root.
- Index(es):
Relevant Pages
|