Bug 512199 - *.kim export file has a size limit of ~4GB
Summary: *.kim export file has a size limit of ~4GB
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Import/Export (other bugs)
Version First Reported In: GIT master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-16 16:28 UTC by Andreas Schleth
Modified: 2026-08-28 19:00 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schleth 2025-11-16 16:28:33 UTC
SUMMARY
When exporting with images inside the kim file, the file may get bigger than 4GB (esp. if there are vidos among the data). These files cannot be imported or opened as zip files (after renaming).

STEPS TO REPRODUCE
1. Export a lot of media files with the option "include in kim file"
2. Try to import this file into another database

OBSERVED RESULT
kim file cannot be opened

EXPECTED RESULT
kim file should be opened normally

SOFTWARE/OS VERSIONS
KPhotoAlbum: v6.1.0-14-g3705a5703
KDE Frameworks: 6.17.0
Qt: Using 6.8.2 and built against 6.8.2
TUXEDO OS (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.14.0-115036-tuxedo

ADDITIONAL INFORMATION
The size limit should be made transparent on export or circumvented by using another zip library that does not have this limitation.
Comment 1 Randall Rude 2025-12-05 18:28:54 UTC
I exported an personal folder with 5.4G of images and videos.

$ unzip -t 2017.kim
Archive:  2017.kim
warning [2017.kim]:  4294967296 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  4294967296
  (attempting to re-compensate)
    testing: Images/imgp0465.mov      OK
error: not enough memory for bomb detection
At least one error was detected in 2017.kim.
$ 7z -t 2017.kim
...
WARNING = 32-bit overflow in headers
...
Comment 2 Randall Rude 2025-12-05 20:58:30 UTC
Interestingly, my command-line zip (from Info-Zip) is built with LARGE_FILE_SUPPORT and can create a valid zip file of the same folder.
$ unzip -qt images/2017.zip                                                                                                 
No errors detected in compressed data of images/2017.zip.
$ echo $?                                                                                                                   
0
$ ls -l images/2017.zip                                                                                                     
-rw-rw-r-- 1 me me 5686177599 Dec  5 12:18 images/2017.zip

So this is a limitation of KZip.
Comment 3 Bug Janitor Service 2025-12-30 02:55:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/kphotoalbum/-/merge_requests/61
Comment 4 Randall Rude 2026-01-03 17:45:07 UTC
Created upstream bug 514177.
Comment 5 Johannes Zarl-Zierl 2026-02-15 17:23:00 UTC
Until there is an upstream resolution, kphotoalbum mitigates the bug by not allowing .kim files over 4GB:
https://invent.kde.org/graphics/kphotoalbum/-/commit/bd21e0a672e67d96cf23a43232375e532a563d39
Comment 6 Randall Rude 2026-08-03 15:58:34 UTC
The link in comment #4 is incorrect.  The correct upstream link is https://bugs.kde.org/show_bug.cgi?id=514117.

The upstream bug is now fixed.

Testing with the latest upstream build of karchive and the kphotoalbum workaround patch from comment #5 disabled, kphotoalbum  exported a valid 5.4GB file:

$ du -sh 2017.kim 
5.4G    2017.kim
$ unzip -qt 2017.kim
No errors detected in compressed data of 2017.kim.

The 5.4G file was successfully imported into a new database.

We can remove the workaround patch and resolve this bug once the karchive fix is released.
Comment 7 Bug Janitor Service 2026-08-15 16:32:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/kphotoalbum/-/merge_requests/94
Comment 8 Randall Rude 2026-08-20 01:45:19 UTC
KPhotoAlbum now limits the size of an export file to less than 4 GB unless built against KArchive version 6.29.0 or later.
Comment 9 Johannes Zarl-Zierl 2026-08-28 19:00:11 UTC
Git commit 0059d7b4830bdca9d8f3ab03fff1e3cd37d5c0cc by Johannes Zarl-Zierl.
Committed on 28/08/2026 at 18:59.
Pushed by johanneszarl into branch 'master'.

Update Changelog
Related: bug 512204

M  +2    -0    CHANGELOG.md

https://invent.kde.org/graphics/kphotoalbum/-/commit/0059d7b4830bdca9d8f3ab03fff1e3cd37d5c0cc