Bug 374431 - Version 5.1 crashes when reading some index files
Summary: Version 5.1 crashes when reading some index files
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: general (show other bugs)
Version: 5.1
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-01 18:39 UTC by Alex6
Modified: 2017-01-02 22:31 UTC (History)
1 user (show)

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


Attachments
Message (?) (29.73 KB, image/png)
2017-01-01 18:39 UTC, Alex6
Details
attachment-23844-0.html (6.82 KB, text/html)
2017-01-01 20:31 UTC, Alex6
Details
attachment-24760-0.html (4.49 KB, text/html)
2017-01-01 20:50 UTC, Alex6
Details
attachment-26834-0.html (3.48 KB, text/html)
2017-01-02 08:44 UTC, Alex6
Details
attachment-26734-0.html (7.57 KB, text/html)
2017-01-02 19:49 UTC, Alex6
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex6 2017-01-01 18:39:01 UTC
Created attachment 103130 [details]
Message (?)

5.1 crashes with attached message on startup (no message when started in console)
(self-compiled or majjaro package give same result).

Other index files in different repertories can be read without problem.

(the "bad" index represent circa 22000 images, the others very less)
Comment 1 Johannes Zarl-Zierl 2017-01-01 19:59:50 UTC
Can you post the offending line, plus a little of context of the "bad" index.xml file? If you use the commandline, "head -n 702 index.xml |tail" should be fine.

If there is sensitive information (e.g. names) in the output, you can replace it with '*' characters or similar...
Comment 2 Alex6 2017-01-01 20:31:58 UTC
Created attachment 103131 [details]
attachment-23844-0.html

Thanks for quick reply!

Here is:
*[ego@xyz Photos]$* head -n 702 index.xml |tail 
*[ego@xyz Photos]$* 




Le dimanche 1 janvier 2017 19:59:50 CET, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=374431
> 
> Johannes Zarl-Zierl <johannes@zarl-zierl.at> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |johannes@zarl-zierl.at
> 
> --- Comment #1 from Johannes Zarl-Zierl <johannes@zarl-zierl.at> ---
> Can you post the offending line, plus a little of context of the "bad"
> index.xml file? If you use the commandline, "head -n 702 index.xml |tail"
> should be fine.
> 
> If there is sensitive information (e.g. names) in the output, you can replace
> it with '*' characters or similar...
> 
>
Comment 3 Alex6 2017-01-01 20:50:28 UTC
Created attachment 103132 [details]
attachment-24760-0.html

Tried to remove the "bad" image and regenerate the index with kpa 4.7.
kpa 5.1 crashes with same error on another line...

Le dimanche 1 janvier 2017 19:59:50 CET, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=374431
> 
> Johannes Zarl-Zierl <johannes@zarl-zierl.at> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |johannes@zarl-zierl.at
> 
> --- Comment #1 from Johannes Zarl-Zierl <johannes@zarl-zierl.at> ---
> Can you post the offending line, plus a little of context of the "bad"
> index.xml file? If you use the commandline, "head -n 702 index.xml |tail"
> should be fine.
> 
> If there is sensitive information (e.g. names) in the output, you can replace
> it with '*' characters or similar...
> 
>
Comment 4 Johannes Zarl-Zierl 2017-01-01 22:10:45 UTC
The snippet of your index.xml looks ok. Is this snippet directly from KPA 4.7 or after starting KPA 5.1?

If possible, could you send me the problematic index.xml file via email?
Comment 5 Alex6 2017-01-02 07:42:40 UTC
The problematic lines are annotations made with versions of kpa probably older then 4.7.
Attached the index.xml file.

Le dimanche 1 janvier 2017 22:10:45 CET, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=374431
> 
> --- Comment #4 from Johannes Zarl-Zierl <johannes@zarl-zierl.at> ---
> The snippet of your index.xml looks ok. Is this snippet directly from KPA 4.7
> or after starting KPA 5.1?
> 
> If possible, could you send me the problematic index.xml file via email?
> 
>
Comment 6 Alex6 2017-01-02 08:44:36 UTC
Created attachment 103140 [details]
attachment-26834-0.html

*The problematic lines are annotations made with versions of kpa probably older then 4.7.*
*The index.xml file is here:*

*https://framadrop.org/r/nRgCs1Ze21#mUK269XJhkYk7e5EpvClhL6CXz9spsmcoUOILg3DXhs=*


*Le dimanche 1 janvier 2017 22:10:45 CET, vous avez écrit :*
*> https://bugs.kde.org/show_bug.cgi?id=374431*
*> *
*> --- Comment #4 from Johannes Zarl-Zierl <johannes@zarl-zierl.at> ---*
*> The snippet of your index.xml looks ok. Is this snippet directly from KPA 4.7*
*> or after starting KPA 5.1?*
*> *
*> If possible, could you send me the problematic index.xml file via email?*
*> *
*> *
Comment 7 Johannes Zarl-Zierl 2017-01-02 16:56:18 UTC
Thanks.

The issue seems to be that your camera puts the string "WANGZ^B" into the EXIF description.

Between Qt4 and Qt5, the handling of control characters like '\x02' ('^B') seems to have changed, which causes KPhotoAlbum to choke on the previously working database.

As an immediate workaround you can remove the '^B' characters from your database:

 mv index.xml index.xml.bak
 sed 's/\x02/#/' index.xml.bak > index.xml
Comment 8 Alex6 2017-01-02 19:49:37 UTC
Created attachment 103148 [details]
attachment-26734-0.html

Thanks! it works!

Not understood where te "WANGZ^B" comes from...
Not apparently from camera: the so tagged images were transformed from Nef Nikon D80 with Gimp for 6/7 years and saved as xcf or jpg , Gimp ignored metadata, related nef files in this index have no "WANGZ^B" tag...
Hav*e pasted this accidentally?*

Thanks again and happy Kpa + personal/private* 2017 !!

*My taylor is rich, but my english is poor.



Le lundi 2 janvier 2017 16:56:18 CET, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=374431
> 
> Johannes Zarl-Zierl <johannes@zarl-zierl.at> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>      Ever confirmed|0                           |1
>              Status|UNCONFIRMED                 |CONFIRMED
> 
> --- Comment #7 from Johannes Zarl-Zierl <johannes@zarl-zierl.at> ---
> Thanks.
> 
> The issue seems to be that your camera puts the string "WANGZ^B" into the EXIF
> description.
> 
> Between Qt4 and Qt5, the handling of control characters like '\x02' ('^B')
> seems to have changed, which causes KPhotoAlbum to choke on the previously
> working database.
> 
> As an immediate workaround you can remove the '^B' characters from your
> database:
> 
>  mv index.xml index.xml.bak
>  sed 's/\x02/#/' index.xml.bak > index.xml
> 
>
Comment 9 Johannes Zarl-Zierl 2017-01-02 22:16:32 UTC
Git commit 0088b7aa3a6b8824d23f68f0f821fe3d4a07a012 by Johannes Zarl-Zierl.
Committed on 02/01/2017 at 22:12.
Pushed by johanneszarl into branch 'master'.

Prevent invalid characters in image description.

Some cameras seem to add invalid characters (i.e. control characters) to
the Exif.Image.ImageDescription. When the description is saved into the
database, we end up with an invalid index.xml file.
This patch removes control characters from the exif image description.

M  +4    -1    DB/FileInfo.cpp

https://commits.kde.org/kphotoalbum/0088b7aa3a6b8824d23f68f0f821fe3d4a07a012
Comment 10 Johannes Zarl-Zierl 2017-01-02 22:29:55 UTC
Git commit 680499cfaafc8e57dfb38f2c0685f58ba0b1fc3f by Johannes Zarl-Zierl.
Committed on 02/01/2017 at 22:29.
Pushed by johanneszarl into branch '4.7'.

Prevent invalid characters in image description.

Some cameras seem to add invalid characters (i.e. control characters) to
the Exif.Image.ImageDescription. When the description is saved into the
database, we end up with an invalid index.xml file.
This patch removes control characters from the exif image description.

M  +4    -1    DB/FileInfo.cpp

https://commits.kde.org/kphotoalbum/680499cfaafc8e57dfb38f2c0685f58ba0b1fc3f
Comment 11 Johannes Zarl-Zierl 2017-01-02 22:31:37 UTC
With commit 0088b7aa this situation should not occur again.

Unfortunately, there's not much we can do inside kphotoalbum to fix an index.xml file that already contains invalid characters. But since the workaround fixed your immediate problem, I'll close this bug anyways...