Bug 511440

Summary: Import of video files ignores exif data
Product: [Applications] kphotoalbum Reporter: Andreas Schleth <schleth_es>
Component: Import/ExportAssignee: KPhotoAlbum Bugs <kphotoalbum-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: rsquared42
Priority: NOR    
Version First Reported In: GIT master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: video file with exif data

Description Andreas Schleth 2025-10-31 19:32:04 UTC
Created attachment 186368 [details]
video file with exif data

SUMMARY

When importing video files, exif data are ignored, even if they are present.

STEPS TO REPRODUCE
1. use attached video file as example
2. create a new folder and copy the video into this folder
3. start kphotoalbum from the command line inside this folder with "kphotoalbum -c index.xml"
4. create a new index file
5. if necessary, use "Maintenance -> search for new images" to add this video to the database.

OBSERVED RESULT
* KPA will display the date of the file as shown with "ls -l"
* KPA will show no exif data for this file
* using "exiftool  VID_20250824_110625837.mp4" shows the complete list of exif data.
* "exiftool -createdate VID_20250824_110625837.mp4" displays the correct date:  "Create Date                     : 2025:08:24 ..."
* "Maintenance -> Read EXIF info from files ..." does not read anything from this video file.

EXPECTED RESULT
* KPA should at least try to read the exif info if present and issue a warning if it fails to do so.

SOFTWARE/OS VERSIONS
KPhotoAlbum: v6.1.0-14-g3705a5703  (not the very latest - but fairly recent)
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-114034-tuxedo

ADDITIONAL INFORMATION
The same applies for files imported via a *kim file
My current workaround is to touch the files with the correct date ... very cumbersome!
Comment 1 Randall Rude 2025-11-04 16:04:02 UTC
A duplicate of bug 472520?
Comment 2 Andreas Schleth 2025-11-04 19:34:23 UTC
(In reply to Randall Rude from comment #1)
> A duplicate of bug 472520?

Yes it seems so.

Then this issue is already 2 years old...
Comment 3 Andreas Schleth 2025-11-12 16:17:30 UTC
OK, this is *NOT* really a duplicate: the issue occurs on importing new videos (e.g. from SD card) *and* on importing tagged media from *.kim file.

steps 1-x:
* have a kpa database (index.xml) with images and videos - all dates corrected in exif and as file date (touch ...).
* export some images and videos as *.kim with files included in the *.kim file
* open a different database
* import the *.kim file

result:
* all files show the current date/time in the file system
* the images have the correct date/time in the database
* all videos have the current date/time (wrong!) in the database

expected result:
* at least all the files should have date/time from the *.kim file
* it would be better, if date/time in the file system would be kept as original
Comment 4 Bug Janitor Service 2025-11-13 22:22:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/kphotoalbum/-/merge_requests/55
Comment 5 Randall Rude 2025-11-25 17:48:12 UTC
Tested with recent git master (b6af9135e so prior to the patch for bug 472520) as follows:
* start a fresh copy of the demo
* export everything to a .kim file (I chose to include the images in the ,kim file)
* close the demo
* create an empty directory foo and start kphotoalbum with --db foo/
* import the .kim file from step 2 (I just clicked Next for all steps)
* save the db and exit kphotoalbum
* note movie.avi in the new db has the current date and time.

There are some other differences (are these intentional?):
* rotation angles are not preserved;
* user-specified date/time from the demo are not preserved - the date/time in the new db are all from the EXIF data (except for movie.avi);
* annotation areas are not preserved.
Comment 6 Randall Rude 2025-11-25 18:06:48 UTC
Repeated the steps listed in comment #5 with current HEAD (df369d21a so with the patch for bug 472520).  The date/time for movie.avi in the new db is from the creation_time tag in the file header (2006-10-29T14:33:55).

So the patch for bug 472520 also fixes this issue.
Comment 7 Andreas Schleth 2025-11-25 19:37:41 UTC
I just repeated the steps from Comment 5 with the latest git master (fresh build from git master just now):
KPhotoAlbum: v6.1.0-65-gfa2975aa8
KDE Frameworks: 6.19.0
Qt: Using 6.9.2 and built against 6.9.2
TUXEDO OS (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.14.0-116036-tuxedo

Directly after import (before saving), the jesper-movie and one image of grand canyon are listed with the current date after import (2 in the timeline).
But when I annotate the movie, the date is shown correctly (2006) and after saving and re-opening it is listed correctly in the timeline.

To recap:
* For the movie the preservation of the date works *mostly*.
* The timeline is incorrect after import but gets updated after annotation or save/re-open.
* Files without any date in the exif data are assigned the current date.
==> I think, they should get the date from the kim file (in all cases).

So, there is definitely progress, but not yet at 100%.

Thanks for looking into this issue.