Bug 163529

Summary: Export to CD: pictures too large for browser
Product: [Applications] digikam Reporter: Axel Braun <axel.braun>
Component: Plugin-Generic-ArchiveAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: digikam-bugs-null
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: option in settings dialog
patch 1

Description Axel Braun 2008-06-08 14:25:50 UTC
Version:           0.9.3 (using 3.5.9 "release 57.3" , openSUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.22.17-0.1-default

I've exported some pictures to DVD. Nice HTML-overview, but when viewing a single picture, it is far too big: e.g., if it is scaled 3000x2000 resolution, the picture is shown that big in the HTML-page. No chance to rescale it (Firefox/Konqueror).

We would need an option that shows the picture scaled, similar as in this reference:
<a href="img/tracks/20070331.jpg"><img style="border: 0px solid ; width: 98px; height: 55px;" alt="Picture" src="img/tracks/tracks_thumbs/20070331.jpg"> 

Or can I manipulate the output somewhere in Digikam?
Comment 1 Andi Clemens 2008-06-08 14:58:28 UTC
Created attachment 25205 [details]
option in settings dialog

Hi,

just set the following option shown in the dialog. Please tell me if this is
what you wanted to achieve... so I can close this bug report again.
Comment 2 Andi Clemens 2008-06-08 14:59:59 UTC
Just a little note: Set the image size in "save image" to the value you want to have. Now the images are smaller and should fit into the browser. The download option is for showing the original size of the image.
Comment 3 Axel Braun 2008-06-08 17:25:47 UTC
Hi Andi,
this options dialog is for Album->Export->HTML-Gallery, it does not show up in Export->Picture CD.
Of course I want all pictures in full size format on the CD, but the preview should be smaller.
Comment 4 Andi Clemens 2008-06-08 18:51:42 UTC
Hi Axel,

sorry I misread your post :-)
You are right there is no option to scale the images. By the way this is not a problem of digiKam but kipi-plugins. I will change the category.

Gilles,
is this easy to implement?
Comment 5 Axel Braun 2008-06-09 09:33:30 UTC
Yes,  I would really appreciate if this can be solved quickly. I need to create a picture DVD for all participants of a sail-race and would love to spread digikam instead of a shitty Windows software.
As a workaround, can you point me to the template-file to modify for this purpose? 
Thanks!
Axel
Comment 6 Andi Clemens 2008-06-09 11:19:59 UTC
As I can see from the code base there is no template used, everything is hard coded so you will have to change the plugin internally. This is not too hard, but I guess this is not the right solution for you? But if you like to look into the code, I guess http://websvn.kde.org/branches/extragear/kde3/libs/kipi-plugins/cdarchiving/cdarchiving.cpp?view=markup will be a good starting point (function: createPage()).
Comment 7 Andi Clemens 2008-06-09 11:27:23 UTC
Another suggestion: Why not export to HTML gallery and burn the content on a CD? This should work just fine, but maybe autostart will not work for you.
Comment 8 Axel Braun 2008-06-09 13:12:53 UTC
No, if I use the original picture (what I want to give the recipients ful resolution, or because I want to archive the original pictues) I have the same effect for the HTML-Export.
Regarding the SVN...Sorry, I'm not a C++ programmer..ABAP is the only I could do ;-)
Comment 9 Andi Clemens 2008-06-09 14:03:44 UTC
The option shown in the screenshot doesn't work for you? It will create a scaled version of the image for displaying in the album. It will as well save the original file to show in full size if desired.
Comment 10 Axel Braun 2008-06-09 14:19:57 UTC
OK...slightly different source, it should read in the HTML:
<img style="width: 800px; height: 600px;" class="photo" .....
Comment 11 Axel Braun 2008-06-09 15:07:10 UTC
Ah, sorry, this time I misunderstood you. Yes, that would work as well. Maybe I add an autostart before burning the CD.
I tried adding the above statement to the sourcecode you mentioned:
stream << "<img style="width: 800px; height: 600px;" class=\"photo\" 

The error on compiling is:
g++ -DHAVE_CONFIG_H -I./kipi-plugins/cdarchiving -I/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving -I. -I/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/common/include -I/opt/kde3/include -I/opt/kde3/include -I/usr/lib/qt3/include -I. -DQT_THREAD_SUPPORT -D_REENTRANT -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -fPIC -DPIC -c /usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp -o ./kipi-plugins/cdarchiving/.libs/cdarchiving.o -Wp,-MD,./kipi-plugins/cdarchiving/.deps/cdarchiving.TUlo
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp:1212:39: error: invalid suffix "px" on integer constant
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp:1212:54: error: invalid suffix "px" on integer constant
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp: In member function ‘bool KIPICDArchivingPlugin::CDArchiving::createPage(const QString&, const KURL&, const QString&, const KURL&, const QString&, const KURL&, const QString&, const QString&)’:
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp:1212: error: expected `;' before ‘width’
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp:1212: error: no match for ‘operator<<’ in ‘" class=\"photo\" src=\"../../../" << ((KIPICDArchivingPlugin::CDArchiving*)this)->KIPICDArchivingPlugin::CDArchiving::m_AlbumTitle’
/usr/lib/qt3/include/qcstring.h:135: note: candidates are: QDataStream& operator<<(QDataStream&, const QByteArray&)
/usr/lib/qt3/include/qcstring.h:247: note:                 QDataStream& operator<<(QDataStream&, const QCString&)
/usr/lib/qt3/include/qstring.h:828: note:                 QDataStream& operator<<(QDataStream&, const QString&)
/usr/lib/qt3/include/qtextstream.h:304: note:                 QTextStream& operator<<(QTextStream&, QTextStream& (*)(QTextStream&))
/usr/lib/qt3/include/qtextstream.h:307: note:                 QTextStream& operator<<(QTextStream&, QTSManip)
/usr/lib/qt3/include/qdatetime.h:244: note:                 QDataStream& operator<<(QDataStream&, const QDate&)
/usr/lib/qt3/include/qdatetime.h:246: note:                 QDataStream& operator<<(QDataStream&, const QTime&)
/usr/lib/qt3/include/qdatetime.h:248: note:                 QDataStream& operator<<(QDataStream&, const QDateTime&)
/usr/lib/qt3/include/qfont.h:367: note:                 QDataStream& operator<<(QDataStream&, const QFont&)
/usr/lib/qt3/include/qpoint.h:103: note:                 QDataStream& operator<<(QDataStream&, const QPoint&)
/usr/lib/qt3/include/qsize.h:111: note:                 QDataStream& operator<<(QDataStream&, const QSize&)
/usr/lib/qt3/include/qrect.h:162: note:                 QDataStream& operator<<(QDataStream&, const QRect&)
/usr/lib/qt3/include/qglist.h:208: note:                 QDataStream& operator<<(QDataStream&, const QGList&)
/usr/lib/qt3/include/qstringlist.h:102: note:                 QDataStream& operator<<(QDataStream&, const QStringList&)
/usr/lib/qt3/include/qcolor.h:225: note:                 QDataStream& operator<<(QDataStream&, const QColor&)
/usr/lib/qt3/include/qpixmap.h:333: note:                 QDataStream& operator<<(QDataStream&, const QPixmap&)
/usr/lib/qt3/include/qimage.h:265: note:                 QDataStream& operator<<(QDataStream&, const QImage&)
/usr/lib/qt3/include/qregion.h:172: note:                 QDataStream& operator<<(QDataStream&, const QRegion&)
/opt/kde3/include/kurl.h:1825: note:                 QDataStream& operator<<(QDataStream&, const KURL&)
/usr/lib/qt3/include/qvariant.h:390: note:                 QDataStream& operator<<(QDataStream&, const QVariant&)
/usr/lib/qt3/include/qvariant.h:392: note:                 QDataStream& operator<<(QDataStream&, QVariant::Type)
/usr/lib/qt3/include/qbrush.h:90: note:                 QDataStream& operator<<(QDataStream&, const QBrush&)
/usr/lib/qt3/include/qpalette.h:181: note:                 QDataStream& operator<<(QDataStream&, const QColorGroup&)
/usr/lib/qt3/include/qpalette.h:184: note:                 QDataStream& operator<<(QDataStream&, const QPalette&)
/usr/lib/qt3/include/qkeysequence.h:93: note:                 QDataStream& operator<<(QDataStream&, const QKeySequence&)
/usr/lib/qt3/include/qsplitter.h:163: note:                 QTextStream& operator<<(QTextStream&, const QSplitter&)
/usr/src/packages/BUILD/kipi-plugins-0.1.5/kipi-plugins/cdarchiving/cdarchiving.cpp:1212: warning: label ‘height’ defined but not used
Error creating ./kipi-plugins/cdarchiving/cdarchiving.lo. Exit status 1.
makeobj[0]: Leaving directory `/usr/src/packages/BUILD/kipi-plugins-0.1.5'
error: Bad exit status from /var/tmp/rpm-tmp.65689 (%build)


...I assume you have an idea what the problem is ;-)
Comment 12 Andi Clemens 2008-06-09 15:51:26 UTC
Well at last for me the created ISO (burned with k3b and the standard data cd project) will automatically start konqueror with the exported html gallery, so this might work for you as well. I have not added any autostart function.

For the compile error: You have to enclose the size values like this:

"<img style=\"width: 800px; height: 600px;\" class=\"photo\"

but I think it is even better to read when using single quotes:

"<img style='width: 800px; height: 600px;' class='photo'

Something will work :-)
Comment 13 Axel Braun 2008-06-09 21:16:37 UTC
>For the compile error: You have to enclose the size values like this: 
>"<img style=\"width: 800px; height: 600px;\" class=\"photo\" 
 
Yes, after I posted I saw it as well :-)
Thanks so far, I builded a plugin-version with hardcoded picture size - that should help for the moment.

Thanks again
Axel
Comment 14 Axel Braun 2008-06-10 09:41:25 UTC
...looks like there is still a little bug: There is a popup coming up when creating a cd-archive: creating preview for picture... etc.
During that process the status bar remains on 0%.
It jumps to 100% once k3b is called
Comment 15 Andi Clemens 2008-06-10 13:49:09 UTC
Created attachment 25238 [details]
patch 1

Hi,

this patch solves the problem with the progressbar.
m_total is not calculated correctly, if you have a lot of images, the
progressbar is not moving a long time, this is wrong I guess.
Now total number of images is added to m_total to make the progress bar move
again.
Comment 16 Andi Clemens 2008-06-10 13:50:50 UTC
This kipi-plugin needs a little source code formatting, it is messed up in some places (mostly indention). If I commit this patch, may I also (in a second patchset) reformat cdarchieving plugin?
Comment 17 Axel Braun 2008-06-10 14:08:03 UTC
Great, thanks.
One remark: For the preview size (comment 10), in the 'final solution',  you need to take into account if a picture is landscape or portrait -> otherwise it gets 'stretched'
Comment 18 Andi Clemens 2008-06-10 18:59:32 UTC
SVN commit 819128 by aclemens:

fixed progress bar issue... the number of total actions was not calculated correctly, so when exporting many images, the progress bar didn't move for quite a long time.

CCBUG: 163529
TODO: KDE4PORT

 M  +25 -18    cdarchiving.cpp  
 M  +4 -4      cdarchiving.h  
 M  +6 -5      plugin_cdarchiving.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=819128
Comment 19 caulier.gilles 2008-06-10 19:06:14 UTC
Andy,

Feel free to patch this plugin. The coding style need to be reformatted/polished of course.

The header of all source code (.cpp/.h) need to be homogenized like others plugins (Dixit Achim Bohnet tips from Debian team). Look in RawConverter plugins for ex.

Note: i will personally never port this plugin to KDE4. we have others plan with Marcel in digiKam core about a backup/restore tool which will supports digiKam database.

Gilles Caulier
Comment 20 Andi Clemens 2008-06-10 19:13:58 UTC
Ok, Angelo asked me to maintain the plugin (and port it to KDE4) because he has no time right now. But if we don't port it, I will see if I can add the options suggested by the reporter of the bug.
Comment 21 caulier.gilles 2008-06-10 19:26:18 UTC
There are other way to study : if i'm not too wrong, K3B provide a shared library. we can use it instead a run-time depency. Look here :

http://websvn.kde.org/branches/extragear/kde3/multimedia/k3b/libk3b/

Amarok do not use this way in KDE3 code, but DCOP: 

http://websvn.kde.org/branches/amarok/1.3/src/k3bexporter.cpp?revision=630995&view=markup

I don't know why...

Gilles
Comment 22 Angelo Naselli 2008-06-15 16:05:40 UTC
>There are other way to study : if i'm not too wrong, 
> K3B provide a shared library. we can use it instead a run-time depency
Yes that was my idea to re-implement it...

Angelo