Bug 118533

Summary: Automatic generation of text from EXIF info / digiKam metadata in Insert Text tool [patch]
Product: [Applications] digikam Reporter: Ben Allen <mrsecure>
Component: Plugin-Editor-InsertTextAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: caulier.gilles, i898210, metzpinguin
Priority: NOR    
Version: 0.8.2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Adding An EXIF DATE/TIME STAMP
Looked Over the Issues Mentioned !
Added Date/Time Stamp in InsertText Tool
Added Date/Time Stamp And Fixed The Default Issue Issue
Modified Patch !
Placeholder Patch !

Description Ben Allen 2005-12-17 19:41:05 UTC
Version:           0.8.8 (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

It would be really nice to be able to use place holders in the Insert Text to place EXIF info or digiKam metadata in the image.  Examples:
  %Y-%M-%d    displays date from EXIF info
  %c          displays EXIF comment field
  %C          displays DigiKam commend data
  %T{People}  displays all of the DigiKam tags from the "People" group for this image.
  
Additionally, being able to specify the text size & location as a percentage of the image height / width would allow for batch processing.  For example, a batch process to write a list of people and the location on a set of images could be something like:
   Text:  %T{People}  %T{Location}
   Text Height:   5% of Height
   Text Location - measured from the center of the text
        Vertical:   5% from bottom
        Horizontal: Centered 

Finally, being able to specify the opacity of the text would be great.

Thanks for all of your hard work on digiKam!  It's excellent!!
Comment 1 Joerg Kadau 2006-11-28 10:53:28 UTC
an selection of variables and positions of the text in the image would be nice.

Comment 2 Minesh 2007-09-21 13:04:47 UTC
(Using Kubuntu with KDE 3.5.6 and digiKam 0.9.1)

I would love this feature in digiKam. Such a "datestamping" or "timestamping" feature would be incredibly beneficial: to read the EXIF or file data, and put it in the bottom-right corner of the image!

digiKam + KPhotoAlbum = almost unbeatable combination!
Comment 3 Jay Singh Talreja 2019-02-19 10:10:29 UTC
Created attachment 118196 [details]
Adding An EXIF DATE/TIME STAMP

I looked over the issue and tried to add a EXIF Date/Time Stamp in the InsertTexttool.
Which is currenlty limited to DateTImeEdit feature and will be done soon.
Comment 4 caulier.gilles 2019-02-20 08:00:15 UTC
Jay,

In you patch the approach is not the right way.

1/ You don't need in fact QDateTimeEdit. The request from this file is to extract the time-stamp from image and to populate the text editor with these info.
2/ add a QCheckBox to enable/disable this feature in setting view.
3/ When check box is turned on, call a slot to parse image metadata and extract time stamp, and finaly pass the text the d->textEdit editor.

That all, in fact it's very simple.

Gilles Caulier

Notes:
- no need // NEW comment in source code. New line are visible in patch format.
- text in i18n() are literal strings for translators. Don't use extra uppercases.
Comment 5 Jay Singh Talreja 2019-02-20 13:18:57 UTC
Created attachment 118212 [details]
Looked Over the Issues Mentioned !

I tried modifying the code - removed the QDateTimeEdit , Added a CheckBox and connected it to the SLOT.
Comment 6 Jay Singh Talreja 2019-02-20 13:21:40 UTC
//New Comment was for my ease, i will remove it though !
Comment 7 Jay Singh Talreja 2019-02-20 17:15:19 UTC
Created attachment 118219 [details]
Added Date/Time Stamp in InsertText Tool
Comment 8 Jay Singh Talreja 2019-02-20 17:16:39 UTC
Added a feature to insert Date/Time from image's metadata .
Only problem that remains is that after pressing Defaults Button Insert Text Box doesn't work ! Assigned string might be the issue since it doesn't refer to QTextEdit object after Date/Time String has been assigned.
Comment 9 Jay Singh Talreja 2019-02-20 18:33:33 UTC
Created attachment 118225 [details]
Added Date/Time Stamp And Fixed The Default Issue Issue

Final Patch is Here!
New Modification:

-Added a Date/Time Stamp Checkbox to Extract the Date/Time from image's 
 Metadata and insert on the Image Using InsertTextTool

-Removed Unecessary comments.

Fixed:
-Default Button Issue on the last patch submitted !
Comment 10 caulier.gilles 2019-02-21 10:04:23 UTC
From your last patch :

- Why you touch InsertTextWidget implementation to just store a Boolean which is never used ?
- a slot method must take "slot" prefix.
- always put a space to separate function argument, for better readability.
- No Java or Javascript coding style, It's C++ here. A bracket "{" must be preceded by a CR. Whe have enough space, no need pseudo source compression. Code must be easy to read.
- Please look the HACKING file from DK root directory for coding style to follow. This point is VERY important. All the source code must have the same coding style for maintenance. I pass a lot of time to polish code everywhere these last year. I will refuse a patch which do not respect this rule.


Please update your patch and set all previous one as obsoletes in bugzilla.

Gilles Caulier
Comment 11 Maik Qualmann 2019-02-21 10:56:33 UTC
Another point is that we do not really need a Date/Time check box. If you read the description of the bug, the user wants a kind of variable to insert in the text the year, the month or the time. This is easy to implement. Replaced e.g. "% Y" in the text with the year from the Exif metadata.

Maik
Comment 12 Jay Singh Talreja 2019-02-21 14:01:06 UTC
Created attachment 118251 [details]
Modified Patch !

(In reply to caulier.gilles from comment #10)
> From your last patch :
> 
> - Why you touch InsertTextWidget implementation to just store a Boolean
> which is never used ?
> - a slot method must take "slot" prefix.
> - always put a space to separate function argument, for better readability.
> - No Java or Javascript coding style, It's C++ here. A bracket "{" must be
> preceded by a CR. Whe have enough space, no need pseudo source compression.
> Code must be easy to read.
> - Please look the HACKING file from DK root directory for coding style to
> follow. This point is VERY important. All the source code must have the same
> coding style for maintenance. I pass a lot of time to polish code everywhere
> these last year. I will refuse a patch which do not respect this rule.
> 
> 
> Please update your patch and set all previous one as obsoletes in bugzilla.
> 
> Gilles Caulier

i Looked over the coding style format and issues mentioned.

-Formatted Code according to the conventional coding style .
-Removed unnecessary Boolean parameter from the InsertTextWidget.

Jay Singh
Comment 13 Jay Singh Talreja 2019-02-21 16:15:09 UTC
(In reply to Maik Qualmann from comment #11)
> Another point is that we do not really need a Date/Time check box. If you
> read the description of the bug, the user wants a kind of variable to insert
> in the text the year, the month or the time. This is easy to implement.
> Replaced e.g. "% Y" in the text with the year from the Exif metadata.
> 
> Maik

Didn't got the variable thing which you are asking me to implement ?
Comment 14 caulier.gilles 2019-02-23 13:57:34 UTC
I looked the last revision of the patch, and it look good if we use the checkbox option way.

But ad Maik said in comment #11, a more generic way can be implemented, without to use a checkbox. Look well in the bugzilla file description comment, the user want generic place holder to use in comment string to automatically add date, Comment, and tags. This look really better and easily extensible.

You need to parse text string and extract the place holders and replace with right metadata get from image properties.

Gilles Caulier
Comment 15 Jay Singh Talreja 2019-03-01 14:38:05 UTC
Created attachment 118459 [details]
Placeholder Patch !

Updates in new Patch:
->Removed Checkbox Approach to add metadata .
->Set %D as the placeholder in textEdit which replaces itself with the Date from Image's Metadata