Bug 302755 - Improve usability and fix bugs [patch]
Summary: Improve usability and fix bugs [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-WebService-MediaWiki (show other bugs)
Version: 2.6.0
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL: https://www.mediawiki.org/wiki/User:J...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-29 17:24 UTC by Peter Potrowl
Modified: 2018-01-30 21:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.8.0


Attachments
Improvements described in my first post. (46.42 KB, patch)
2012-06-29 17:25 UTC, Peter Potrowl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Potrowl 2012-06-29 17:24:01 UTC
Jean-Frédéric and I have tutored two students (Nathan and Iliya) who improved a lot this KIPI plugin. I also participated in the coding.

Here is the description of what we have done, which is present in the attached patch.

We add text fields so that the user can view and edit the metadata that will be uploaded on the distant wiki: title, date, text description, categories, latitude, longitude.

Those metadata are pre-filled with the information that digiKam possesses: file name for title, EXIF date and time for date, title for text description, tags for categories, geo-localization for latitude and longitude.

Those metadata can be edited field-by-field, image per image or by groups of images. If one image is selected in the image list on the left, the modifications will be applied to it. If several images are selected, the modifications will be applied to all the selected images. Only the modified fields are applied to the selected images: the fields that were not modified stay different for each file, which is believed to be the most expected and easy-to-use behavior.

In order to allow the modification of those metadata for each file, we store them in a QMap, based on the file path.

The metadata are used to generate a wikitext that will be imported on the distant wiki along with the image. This was already the case in the previous version, but we corrected it: the wikitext syntax was incorrect (spaces at the beginning of the lines, missing line breaks, incorrect position of the categories): http://test.wikipedia.org/w/index.php?title=File:Saint-Vallier-gare.jpg&diff=prev&oldid=127448 ; also, the encoding was wrong: http://commons.wikimedia.org/w/index.php?title=File:Fleur_de_la_Passion.jpg&curid=20037941&diff=73308538&oldid=73308378 ; we set it to UTF-8 which is the default encoding on MediaWiki.

Instead of having the user type the URL of the API (api.php) of the distant wiki (most of users don't even know this exist), we provide a prefilled list of wikis. More experimented users can input their own api.php URL along with the name of their wiki, to be added to the list.

For simplicity, we split the interface in two tabs: upload information and configuration. The first contains the fields meant to view and edit the metadata of each file. The second contains the information that is valid for all the group of files: destination wiki, login form, license, resize option.

We fix a problem with space ("%20" instead of "_") in file names.
We fix the resizing of the image, which was not performed even when the checkbox was checked.

Those changes are summed up (in French) in this page: [1]
The edited source code is hosted on GitHub: [2]
This code has been successfully compiled and tested by a few people (including me). Some images have been successfully uploaded on Wikimedia Commons: [3]
A documentation will be written here: [4]
Screenshots of the current version can be seen here: [5]

[1] https://www.mediawiki.org/wiki/User:Jean-Frédéric/digiKam
[2] https://github.com/peter17/kipi-plugins
[3] http://commons.wikimedia.org/wiki/Category:Uploaded_with_KIPI_uploader
[4] http://commons.wikimedia.org/wiki/Commons:Tools/KIPI_uploader
[5] http://commons.wikimedia.org/wiki/Category:MediaWiki_KIPI_uploader

Known bugs:
* When the user selects more than one image on the left, the description and categories fields are not updated on the right, whereas title, date, latitude and longitude are. This is due to a limitation of KTextEdit and avoids a loss of data (if we update those fields, textChanged() will be called and the changed field will be applied to all the selected files even if not modified, which is unexpected)
* The upload fails behind a proxy (bug #302598 reported on libmediawiki)
* The login and/or upload sometimes fails unexpectedly. This was already the case with the previous version.
* The login/error messages are poorly detailed, which does not help to understand the previous point.
* The presence of a file with the same name or same SHA1 on the distant wiki is not yet tested.

I intend to work on some of the above points in a not-to-far future, but I would like the current improvements be merged before.

So, we are asking that this code should be merged into kipi-plugins trunk.

Thanks in advance

Reproducible: Always
Comment 1 Peter Potrowl 2012-06-29 17:25:06 UTC
Created attachment 72221 [details]
Improvements described in my first post.
Comment 2 caulier.gilles 2012-07-09 08:13:16 UTC
Git commit 43bc0cff2fbe54b76accd2b418f2c2c66b4455f6 by Gilles Caulier.
Committed on 09/07/2012 at 10:11.
Pushed by cgilles into branch 'master'.

Apply patch #72221 from Peter Potrowl about MediaWiki Export tool GUI improvements plus new features.
Review code and polish coding style.

M  +54   -52   mediawiki/wikimediajob.cpp
M  +8    -8    mediawiki/wikimediajob.h
M  +561  -93   mediawiki/wmwidget.cpp
M  +69   -30   mediawiki/wmwidget.h
M  +85   -33   mediawiki/wmwindow.cpp
M  +3    -0    mediawiki/wmwindow.h

http://commits.kde.org/kipi-plugins/43bc0cff2fbe54b76accd2b418f2c2c66b4455f6
Comment 3 caulier.gilles 2012-07-09 08:20:24 UTC
Git commit a4df04e2846f5a357c2a822da48e37222861f7ae by Gilles Caulier.
Committed on 09/07/2012 at 10:19.
Pushed by cgilles into branch 'master'.

use d private internal container

M  +35   -20   mediawiki/plugin_wikimedia.cpp
M  +2    -3    mediawiki/plugin_wikimedia.h

http://commits.kde.org/kipi-plugins/a4df04e2846f5a357c2a822da48e37222861f7ae
Comment 4 caulier.gilles 2012-07-09 08:25:15 UTC
Git commit 744f03a99c542100669f9c8af9e0f8be9015759c by Gilles Caulier.
Committed on 09/07/2012 at 10:24.
Pushed by cgilles into branch 'master'.

use d private internal container
constify

M  +38   -13   mediawiki/wikimediajob.cpp
M  +5    -7    mediawiki/wikimediajob.h

http://commits.kde.org/kipi-plugins/744f03a99c542100669f9c8af9e0f8be9015759c
Comment 5 caulier.gilles 2012-07-09 08:36:55 UTC
Git commit 1bc8ac27872a45e5247152f97ebfa240ee71dad3 by Gilles Caulier.
Committed on 09/07/2012 at 10:36.
Pushed by cgilles into branch 'master'.

use d private internal container

M  +358  -265  mediawiki/wmwidget.cpp
M  +3    -70   mediawiki/wmwidget.h

http://commits.kde.org/kipi-plugins/1bc8ac27872a45e5247152f97ebfa240ee71dad3
Comment 6 caulier.gilles 2012-07-09 08:48:11 UTC
Git commit 204c4de1047d9b17971a21f5c4fed3057dba5456 by Gilles Caulier.
Committed on 09/07/2012 at 10:47.
Pushed by cgilles into branch 'master'.

use d private internal container

M  +89   -58   mediawiki/wmwindow.cpp
M  +3    -26   mediawiki/wmwindow.h

http://commits.kde.org/kipi-plugins/204c4de1047d9b17971a21f5c4fed3057dba5456