Bug 462542 - HTML Gallery behaves oddly
Summary: HTML Gallery behaves oddly
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-HTMLGallery (other bugs)
Version First Reported In: 7.9.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 12:32 UTC by Steve Franks
Modified: 2022-12-08 19:43 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0
Sentry Crash Report:


Attachments
dbgview log file (384.04 KB, text/plain)
2022-12-02 12:32 UTC, Steve Franks
Details
attachment-22117-0.html (1.82 KB, text/html)
2022-12-03 20:35 UTC, Steve Franks
Details
HTML Gallery 2012 Glanville Fritillary.zip (687.08 KB, application/x-zip-compressed)
2022-12-04 11:46 UTC, Steve Franks
Details
attachment-4033-0.html (1.47 KB, text/html)
2022-12-05 11:40 UTC, Steve Franks
Details
attachment-17315-0.html (648 bytes, text/html)
2022-12-05 13:46 UTC, Steve Franks
Details
attachment-30636-0.html (1.63 KB, text/html)
2022-12-07 09:53 UTC, Steve Franks
Details
Small HTML Gallery showing an album and a tag (1.98 MB, application/x-zip-compressed)
2022-12-08 14:45 UTC, Steve Franks
Details
dbgview log Windows 10 digikam 7.10.0 (82.36 KB, text/plain)
2022-12-08 14:48 UTC, Steve Franks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Franks 2022-12-02 12:32:56 UTC
Created attachment 154223 [details]
dbgview log file

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
HTML Gallery tool doesn't filter images correctly. The first Album selected is remembered for subsequence calls to the tool after it was deselected. When an Album is selected, if a Tag is also selected the tool processes images that are not in that album.

STEPS TO REPRODUCE
1.  Start Tools|Create HTML Gallery. Choose albums on the first dialog, select an album and go through all steps to create a gallery. Close, then restart the HTML Gallery Tool, Select Albums on the first screen. When you click Next any Albums selected previously are still selected. Deselect any previous albums and select a different one.
2.  Select Tag(s) on the Tag Tab. Continue to select options as required.
3.  On the final dialog click Next to create an HTML Gallery. 

OBSERVED RESULT
When you finish the steps the display changes to show the process of the gallery generation. Notice that although only a single album was selected the display shows 2 albums are being processed.
When you examine the output there are no images in the selected album and the tag section of the gallery shows images that have the tag, but are outside the selected album.

EXPECTED RESULT
1) Previously selected albums are NOT processed.
2) Images within the selected album are filtered by the tag. i.e. Only images within that album, not all images in all albums which have been allocated that tag. In the example that I used, there are 24 images in 2022, with the tag "Red Admiral", but the output HTML Gallery has 58 HTML pages and 836 images.

SOFTWARE/OS VERSIONS
Windows:  10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Comment 1 caulier.gilles 2022-12-02 12:42:33 UTC
Which kind of album did you select previously ? physical or virtual ?
Comment 2 Maik Qualmann 2022-12-02 13:37:02 UTC
Is digiKam-7.9.0 stated in the bug report correct? I would rather guess 7.8.0. or did you not correctly uninstall a digiKam-8.0.0 test version? Fails to load some plugins that are not allowed to be present in 7.x.x.

Maik
Comment 3 Maik Qualmann 2022-12-02 13:57:55 UTC
A quick test here on Windows, selecting via albums or tags doesn't seem to work.

Maik
Comment 4 Maik Qualmann 2022-12-02 22:17:30 UTC
Git commit f367406ec0edd2f9ab1989a60278dd555d4d575d by Maik Qualmann.
Committed on 02/12/2022 at 22:16.
Pushed by mqualmann into branch 'master'.

fix QRegularExpression::wildcardToRegularExpression()
QRegularExpression::wildcardToRegularExpression() excludes
"/", we need to modify the pattern string to match paths.

M  +3    -2    core/libs/database/coredb/coredbnamefilter.cpp

https://invent.kde.org/graphics/digikam/commit/f367406ec0edd2f9ab1989a60278dd555d4d575d
Comment 5 Maik Qualmann 2022-12-02 22:26:29 UTC
Since the problem cannot be reproduced with the current digiKam-7.9.0 AppImage, I assume, based on the error messages from plugins, that you are using digiKam-7.8.0. This partly uses libraries from digiKam-8.0.0 due to a packing error. The problem is fixed for digiKam-8.0.0.

Maik
Comment 6 Steve Franks 2022-12-03 20:35:28 UTC
Created attachment 154291 [details]
attachment-22117-0.html

I found the problem whilst using 7.8.0 on my Windows 10 PC. I downloaded
and installed 7.9.0 and the problem persists.
I’m not sure what a virtual album is. Each album on my system relates to a
top-level folder on my hard drive.
Steve

On Fri, 2 Dec 2022 at 22:26, Maik Qualmann <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=462542
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|CONFIRMED                   |RESOLVED
>          Resolution|---                         |FIXED
>    Version Fixed In|                            |8.0.0
>
> --- Comment #5 from Maik Qualmann <metzpinguin@gmail.com> ---
> Since the problem cannot be reproduced with the current digiKam-7.9.0
> AppImage,
> I assume, based on the error messages from plugins, that you are using
> digiKam-7.8.0. This partly uses libraries from digiKam-8.0.0 due to a
> packing
> error. The problem is fixed for digiKam-8.0.0.
>
> Maik
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
Comment 7 Steve Franks 2022-12-04 11:46:24 UTC
Created attachment 154302 [details]
HTML Gallery 2012 Glanville Fritillary.zip

digikam-7.9.0-20221202T144203-x86-64-debug.appimage running under MX Linux
is similar. One or more albums must be selected before filtering by tags
(Album 2012 which contains 2012-01-January to 2012-12-December. Tag
Insects/Butterfly/Glanville Fritillary [/ indicates tag hierachy ])
The output shows all images that have the tag and the album page(s) are
empty.
See attached output from HTML Gallery creator when 20
Steve
Comment 8 Maik Qualmann 2022-12-04 12:25:27 UTC
Tested here with the AppImage, no problems. Selecting a tag provides the corresponding images in the gallery.

Enable debug output in the terminal with: export QT_LOGGING_RULES="digikam*=true"

Post the output from the terminal of creating the HTML gallery.

Maik
Comment 9 Steve Franks 2022-12-05 11:40:08 UTC
Created attachment 154328 [details]
attachment-4033-0.html

I discovered this running 7.8.0 under Windows 10, it is the same in 7.9.0
and I attached dbgView output to a previous email.
My Linux PC is misbehaving, it frequently refuses to start, but if I can
make it work I will send the debug output. Do you need jpeg output, or
should I disable it to save space ( export
QT_LOGGING_RULES="digikam*=true;jpeg=false"}?
Steve



On Sun, 4 Dec 2022 at 12:25, Maik Qualmann <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=462542
>
> --- Comment #8 from Maik Qualmann <metzpinguin@gmail.com> ---
> Tested here with the AppImage, no problems. Selecting a tag provides the
> corresponding images in the gallery.
>
> Enable debug output in the terminal with: export
> QT_LOGGING_RULES="digikam*=true"
>
> Post the output from the terminal of creating the HTML gallery.
>
> Maik
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
Comment 10 Steve Franks 2022-12-05 13:46:39 UTC
Created attachment 154331 [details]
attachment-17315-0.html

I agree that a gallery is created which shows all photos with the selected
tag. Isn’t the output supposed to be just images in the selected album(s)
that have that tag?
If you run the gallery creation tool again it seems to be impossible to
remove tags, or albums, which were used on previous occasions.
I’m not able to capture the output displayed by the HTML Gallery tool and I
don’t know how to capture all of the output from digikam in terminal. At
most a few hundred lines can be copied after digikam closes. How does one
save all output?
Thanks
Steve
Comment 11 Maik Qualmann 2022-12-07 09:27:37 UTC
I tested it again here on Windows with digiKam-8.0.0 and albums and tags don't work. Since it works on Linux I suspect something path specific, I'll take a look.

Maik
Comment 12 Steve Franks 2022-12-07 09:53:10 UTC
Created attachment 154387 [details]
attachment-30636-0.html

I couldn’t get either to work, as I expected, but the appimage did produce
output for both the selected album and tag.
Is it possible to capture all of the debugging output including that from
the Create HTML Gallery tool?
Steve

On Wed, 7 Dec 2022 at 09:27, Maik Qualmann <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=462542
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|RESOLVED                    |REOPENED
>          Resolution|FIXED                       |---
>
> --- Comment #11 from Maik Qualmann <metzpinguin@gmail.com> ---
> I tested it again here on Windows with digiKam-8.0.0 and albums and tags
> don't
> work. Since it works on Linux I suspect something path specific, I'll take
> a
> look.
>
> Maik
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are on the CC list for the bug.
Comment 13 Maik Qualmann 2022-12-07 11:36:55 UTC
Git commit c1a9acf506c95e093fd1ec328580d067ecb8b098 by Maik Qualmann.
Committed on 07/12/2022 at 11:36.
Pushed by mqualmann into branch 'master'.

add test debug for Windows

M  +2    -0    core/dplugins/generic/tools/htmlgallery/generator/gallerygenerator.cpp
M  +4    -0    core/libs/database/coredb/coredbnamefilter.cpp

https://invent.kde.org/graphics/digikam/commit/c1a9acf506c95e093fd1ec328580d067ecb8b098
Comment 14 Steve Franks 2022-12-07 13:52:29 UTC
I downloaded 7.10.0 debug for Windows and have attached the DebugView
output.
The reason that there were no images for the galleries created
for albums in my earlier po0sts, is that the tool doesn't include
sub-folders. If a lowest level Album (sub-folder) is selected the the
output contains a link for the Album and a Link for the Tag (see attached).
Steve

On Wed, 7 Dec 2022 at 11:36, Maik Qualmann <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=462542
>
> --- Comment #13 from Maik Qualmann <metzpinguin@gmail.com> ---
> Git commit c1a9acf506c95e093fd1ec328580d067ecb8b098 by Maik Qualmann.
> Committed on 07/12/2022 at 11:36.
> Pushed by mqualmann into branch 'master'.
>
> add test debug for Windows
>
> M  +2    -0
> core/dplugins/generic/tools/htmlgallery/generator/gallerygenerator.cpp
> M  +4    -0    core/libs/database/coredb/coredbnamefilter.cpp
>
>
> https://invent.kde.org/graphics/digikam/commit/c1a9acf506c95e093fd1ec328580d067ecb8b098
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are on the CC list for the bug.
Comment 15 Steve Franks 2022-12-08 14:45:51 UTC
Created attachment 154429 [details]
Small HTML Gallery showing an album and a tag

This is the HTML gallery from 7.10.0
Comment 16 Steve Franks 2022-12-08 14:48:02 UTC
Created attachment 154431 [details]
dbgview log Windows 10 digikam 7.10.0

This is the debug view log captured whilst generating HTML Gallery 20110720 Varne.
Windows 10 digikam 7.10.0
Comment 17 Maik Qualmann 2022-12-08 16:35:20 UTC
There are no problems with the HTML gallery with digiKam-7.x.x. Only the albums that are selected will be exported, so sub-albums are not automatically exported. With tags only the images that are assigned to the tag. I always use the image mode, just make the selection in the digiKam main view, mark all and start the HTML tool.
I'll fix the problem with digiKam-8.0.0 this evening.

Maik
Comment 18 Maik Qualmann 2022-12-08 19:43:40 UTC
Git commit 07e073960287e608936473f8f07454607a0c3b2d by Maik Qualmann.
Committed on 08/12/2022 at 19:42.
Pushed by mqualmann into branch 'master'.

fix QRegularExpression wildcard pattern on Windows
FIXED-IN: 8.0.0

M  +0    -2    core/dplugins/generic/tools/htmlgallery/generator/gallerygenerator.cpp
M  +2    -4    core/libs/database/coredb/coredbnamefilter.cpp
M  +2    -1    core/utilities/import/widgets/importfilter.cpp

https://invent.kde.org/graphics/digikam/commit/07e073960287e608936473f8f07454607a0c3b2d