Bug 427346

Summary: Embed date and the time in EXIF metadata
Product: [Applications] Spectacle Reporter: 21Naown
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: CONFIRMED ---    
Severity: wishlist CC: bharadwaj.raju777, kde, meven.car, meven29, meven, nate, noahadvs
Priority: NOR    
Version First Reported In: 20.08.0   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description 21Naown 2020-10-04 21:59:31 UTC
.
Comment 1 David Redondo 2020-10-05 06:56:00 UTC
Can you explain what the bug is? Or what feature you want?
Comment 2 21Naown 2020-10-05 12:58:52 UTC
In the metadata, I would like to set screenshot’s date and time.
Comment 3 David Redondo 2020-10-05 13:04:11 UTC
I don't fully understand. If you take a screenshot the file has the time in its creation Date, doesn't it? Or are you thinking about some other metadata?
Comment 4 21Naown 2020-10-06 00:14:59 UTC
There is an option to set screenshot’s date and time in the filename.
There is not an option to set screenshot’s date and time in the metadata.
Comment 5 Bug Janitor Service 2020-10-21 04:33:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Christoph Feck 2020-10-21 20:41:34 UTC
Requested information was added with comment 4; changing status.
Comment 7 Méven Car 2021-01-31 06:57:20 UTC
I guess it is about exif metadata.
Comment 8 21Naown 2021-02-01 04:34:09 UTC
Yes for some file format. It may be different for the PNG file format.
Comment 9 Bharadwaj Raju 2022-10-03 12:13:05 UTC
PNG doesn't have EXIF, it has its own metadata: https://www.w3.org/TR/PNG/#11textinfo

If we add such a feature, it should probably be behind an option, I think? And on or off by default?
Comment 10 Méven Car 2022-10-03 14:29:51 UTC
> If we add such a feature, it should probably be behind an option, I think? And on or off by default?

I'd say on by default,.

We would need to link to libpng, and re-use what Qt also does: 
https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qpnghandler.cpp#n786

I also wonder if kfile_metadata can extract those.
Comment 11 Bharadwaj Raju 2022-10-03 14:32:20 UTC
(In reply to Méven Car from comment #10) 
> We would need to link to libpng, and re-use what Qt also does: 
> https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qpnghandler.cpp#n786

Not necessary, QImageWriter has what we need: https://doc.qt.io/qt-5/qimagewriter.html#setText
Comment 12 Méven Car 2024-01-28 13:58:54 UTC
(In reply to Bharadwaj Raju from comment #11)
> (In reply to Méven Car from comment #10) 
> > We would need to link to libpng, and re-use what Qt also does: 
> > https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qpnghandler.cpp#n786
> 
> Not necessary, QImageWriter has what we need:
> https://doc.qt.io/qt-5/qimagewriter.html#setText

We could save that in the field "Creation Time" (already supported in kfilemetadata) as specified in https://www.w3.org/TR/PNG/#11keywords.

But `identify -verbose ../Screenshot_20220411_152621-1.png` shows it is already stored in files in properties date:create and date:modify not accessible through QImage ATM.
So I think linking to libpng in kfilemetada should be the way to go to improve compatibility without increasing data storage occupation.