[Digikam-users] How to insert text in a picture

Martin Blank blankmrty at aol.de
Sun Jun 10 16:20:41 BST 2012


Am 10.06.2012 12:09, schrieb Jean-François Rabasse:
>
> On Fri, 8 Jun 2012, Martin Blank wrote:
>
>> Hallo everybody,
>>
>> I can insert a text in a picture by using the watermark function. But
>> how can I define a text which insert the year of the create field in
>> exif data? How can I create a time stamp like some cameras do?
>
> Hello Martin,
>
> Could you explicit a bit more, not what you wish to do, seems clear, but
> *how* you wish to do that ?
>
> 1. Do you plan to do that from inside Digikam, probably using the batch
>    system ?
>
> 2. Do you plan to setup a command line script to do that directly in
>    your images folders ?
>
> If answer is 1, I personaly don't know. Probably experienced DK users
> could help you.
>
> If answer is 2, it's always possible to write a small shell script,
> extracting the image date with a metadata reader such as exiftool.
> In your case, something like :
>  IDATE=`exiftool -exif:datetimeoriginal <Imagefile> | awk '{print $4}'`
> will set you a shell variable with full date in format YYYY:MM:DD
> (you can tweak that with some 'sed' processing.)
>
> After that, the best way to write text onto an image is probably to use
> the Imagemagick convert program, inside your script.
>  convert <OriginalImage> ... label-with ${IDATE} ... <AnnotatedImage>
>
> Concert syntax is not always trivial, but there are dozens of examples
> you can read and adapt. See http://www.imagemagick.org/Usage/annotating/

I hope it go from inside DK, e.g. select file, add them to batch queue
and execute a function like watermark. if there is not anyone who knows
a DK built-in solution, I start writing a script. But it does more work
to select files.

Btw. identify shows the image size. It could be used to scale the text
automaticly.

Thank you.

Martin




More information about the Digikam-users mailing list