Best way to import IPTC tags to tiddlywiki?

208 views
Skip to first unread message

david...

unread,
May 22, 2014, 4:40:37 AM5/22/14
to tiddly...@googlegroups.com
I have a lot of tagged photos I'd like to add to my tiddlywiki. I've decided I'll have the images as linked images rather than image tiddlers, because I like my wiki file to be as small as possible.
 
I've got a .csv of all my image files with their corresponding tags, thanks to the wonderful Exiftool.
 
I'm planning to link to my images by entering them in WikiText [img[http://tiddlywiki.com/favicon.ico]], with the title of each tiddler entered to match the image file name.

However, I'm thinking that to add the tags, I might be best to copy/paste them from my csv file into the html code, after 'tags=' for each tiddler. This will save me entering 4+ tags for each tiddler.
 
So anyway it doesn't seem to me like the best workflow, maybe just the best I know. So I thought I'd ask this list before I went ahead, because maybe someone else has a better idea!
 
Thanks!
 
David.

okido

unread,
May 24, 2014, 7:59:16 AM5/24/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
Hi David,

I would past the whole csv in a tiddler and than write a small javascript that is invoked with the InlineJavascriptPlugin to processes the csv lines to unique tiddlers with name, content and tags.

Have a nice day, Okido

2014年5月22日木曜日 10時40分37秒 UTC+2 david...:

PMario

unread,
May 24, 2014, 10:12:44 AM5/24/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
TiddlyWiki classic or TiddlyWiki 5?
-m

david...

unread,
May 25, 2014, 9:42:40 AM5/25/14
to tiddly...@googlegroups.com
TW5

PMario

unread,
May 25, 2014, 11:59:31 AM5/25/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
Hi David,

At the moment, there is no plugin, that imports a .csv file and splits them into tiddlers.

How did you create your .cvs file. ...

Is your library able to create a bunch of picture files, that look like this

filename eg: image1.jpg.tid

with the content:

created: 20140414210611111
modified: 20140415011511460
title: image1.jpg
type: image/jpg
tags: tag1 tag2 tag3
source: http://tiddlywiki.com/favicon.ico

Some description text about the image.
Multi line is possible.


If yes, it would be possible to build a TiddlyWiki, that includes those tiddlers.
With some transclusion templates, it would be possible to create your desired behaviour.

-mario


Stephan Hradek

unread,
May 26, 2014, 7:52:27 AM5/26/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
Would be a simple perl Some-Liner to create from CSV (or directly using exiftool) the proper tiddlers.

PMario

unread,
May 26, 2014, 3:44:02 PM5/26/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
it would be possible to use a node module https://github.com/dberesford/exiv2node too
-m

david...

unread,
May 26, 2014, 7:06:42 PM5/26/14
to tiddly...@googlegroups.com
So at the moment I'm asking on the exiftool forums how to create files with the content PMario specified.
 
I'm currently able to create it as one file, and I've asked how to create a file for each image.
 
Once I've managed to do that, how will I import them into TW5? What is the fastest method? Can I drag and drop the whole directory?
 
Also, one question on the 'created'/'modified' data (20140414210611111): what are the last three digits for?
 
2014(y)04(m)14(d)21(h)06(m)11(s)111(???)
 
I wouldn't have noticed but my metadata is only returning date and time. My first thought was timezone, but I thought it would need to be four digits for that. I think I can add extra digits if I need to, but what are they?
 
Regards,
 
David

Stephan Hradek

unread,
May 27, 2014, 12:51:29 AM5/27/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc


Am Dienstag, 27. Mai 2014 01:06:42 UTC+2 schrieb david...:

Also, one question on the 'created'/'modified' data (20140414210611111): what are the last three digits for?

Microseconds. Use whatever you want there. Usually I'd put "000".

Stephan Hradek

unread,
May 27, 2014, 12:54:24 AM5/27/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc


Am Montag, 26. Mai 2014 21:44:02 UTC+2 schrieb PMario:
it would be possible to use a node module https://github.com/dberesford/exiv2node too

But ExifTool is written in perl.

PMario

unread,
May 27, 2014, 7:59:44 AM5/27/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
On Tuesday, May 27, 2014 1:06:42 AM UTC+2, david... wrote:
So at the moment I'm asking on the exiftool forums how to create files with the content PMario specified.
 
I'm currently able to create it as one file, and I've asked how to create a file for each image.
 
Once I've managed to do that, how will I import them into TW5? What is the fastest method? Can I drag and drop the whole directory?

Since you are using exiftool I thought you are able to create a "custom tw edition" with a TW node version.

From your previous posts I don't see, which OS you are using?

-m

[1] http://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js:%5B%5BHow%20to%20build%20a%20TiddlyWiki5%20from%20individual%20tiddlers%5D%5D%20%5B%5BInstalling%20TiddlyWiki%20on%20Node.js%5D%5D

PMario

unread,
May 27, 2014, 10:34:12 AM5/27/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
To display a list of imaged, you'll need to do the following:

Lets's say you tagged some images: holiday


create a tiddler named: imageTemplate
content

<img src={{!!source}}/>


create a tiddler named: test
content:

{{{ [tag[holiday]]||imageTemplate }}}

You'll get a list of images

--------

A more advanced template could look like this

<div class="image-list"><img class="list-image" src={{!!source}}/> <span class="list-text" /><$view field="text"/></div>

have fun!
mario


PMario

unread,
May 27, 2014, 10:36:31 AM5/27/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
On Tuesday, May 27, 2014 4:34:12 PM UTC+2, PMario wrote:
A more advanced template could look like this

<div class="image-list"><img class="list-image" src={{!!source}}/> <span class="list-text" /><$view field="text"/></div>

Just did read it again ... you should probably use better class names for the different elements :)

-mario

Eric Shulman

unread,
May 28, 2014, 12:26:28 AM5/28/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
That's MILLIseconds (1/1000 of a second), not MICROseconds (1/1000000 of a second).

-e

Stephan Hradek

unread,
May 28, 2014, 1:12:35 AM5/28/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
You're right.

Danielo Rodríguez

unread,
May 29, 2014, 8:31:49 AM5/29/14
to tiddly...@googlegroups.com
This is getting more and more interesting.
If you succeed please consider making a guide of how use tiddlywiky as a image manager. ;-)

david...

unread,
Jun 3, 2014, 4:06:50 AM6/3/14
to tiddly...@googlegroups.com
Reporting back:
 
So I've succeeded in what I set out to do; which was to import IPTC tags from images into TiddlyWiki5. Thanks to all and especially to PMario for advice and solutions. I also highly recommend exiftool, and Phil Harvey was extremely helpful instructing me with that.
 
A disclaimer for Danielo - I'm not really using my TW as an image manager. What I'm doing is slightly similar, and from what I've learnt, I'm pretty confident it could be done, but that wasn't my purpose just now. Could be an interesting project, though.
 
Some background: I'm helping out at my church to manage risks and maintenance issues - you know, 'this window frame is rotting, needs replacing'; 'these poisons are easily within reach of children, they need to be moved', that type of thing.
 
I wanted to create a wiki as a kind of registry of these issues; and I wanted to make it really easily updated by basically anyone. TiddlyWiki5 is perfect for this.
 
So recently we did a walkthrough of the church properties, and I photographed lots of issues (135, in fact). Afterwards I went through the images and edited them and tagged them, using Picasa, which I think is pretty nice software, but other people seem to hate...
 
Anyway having already tagged these images, I didn't want to repeat the process as I added them into TiddlyWiki. Initially I dragged and dropped the whole lot into my wiki. That wasn't the greatest move, as each was at least 1mb and my wiki became pretty sluggish and didn't load well after that. Also the tags didn't come across and populate the tags in TiddlyWiki, anyway.
 
After exporting the images from Picasa at a web friendly size, and deciding to link to them instead of embedding them, somehow I discovered exiftool for manipulating metadata (probably from this list?). It wasn't exactly easy to learn, but it wasn't too hard, either. And as I said, Phil's pointers were very helpful. That's also around the time I posted my question here.
 
Once Mario had specified the format I needed to create, Phil's Exiftool tips made it pretty easy to get the format from my images and existing tags.
 
I realised though that I didn't actually need the images as tiddlers, for my risk and maintenance registry: the images are a starting point, but I want to be writing more descriptions around them in WikiText. Also, I don't need to create lists of images from the tags, I need the tags to identify specific risks. The images are just the first piece of my description. So I edited my Exiftool output format to place the images in WikiText, rather than as the source image.
 
The next step for me in my project is to go through my notes, adding the image .tid files I've created into my wiki one by one, and writing more on each as I go.
 
tl;dr: Exiftool is great, and I'm creating a risk management registry rather than an image manager.
 
My new workflow:
 
1. Create the .tid file template with all the fields I need. Two examples:
 
created: $CreateDate
modified: $ModifyDate
title: $FileName
type: image/jpg
tags: $Keywords
source: $Directory/$FileName
 
 
created: $CreateDate
modified: $ModifyDate
title: $FileName
tags: $Keywords
 
[img[imgs/$FileName]]
 
 
2. With the template saved (I saved it as TWmetadata.fmt, but you can name it anything), open a terminal window and use exiftool to create the .tid files. The command is:
 
exiftool -p TWmetadata.fmt /imgsDirectory -w %d/out/%f_%e.tid -d %Y%m%d%H%M%S000 -sep " "
 
I've written up what that command means over at the exiftool forum.
 
3. Add the .tid files created to TiddlyWiki. You can drag and drop the whole lot, or add them as needed.
 
[end!]
 
Regards, and again, thankyou for your help.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an
To post to this group, send email to tiddly...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 

Stephan Hradek

unread,
Jun 3, 2014, 4:14:30 AM6/3/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
Great feedback and description.

Did you think about publishing it on (e.g.) TiddlySpot? Or maybe on the new-to-com tiddlywikiguides.org? It might be interesting for many.

Maybe you'll also like to join one of the weekly hangouts (#48 happens to take place today at 4p.m. BST).

PMario

unread,
Jun 3, 2014, 5:52:45 AM6/3/14
to tiddly...@googlegroups.com, gro...@tag.eml.cc
On Tuesday, June 3, 2014 10:06:50 AM UTC+2, david... wrote:
So I've succeeded in what I set out to do; which was to import IPTC tags from images into TiddlyWiki5. Thanks to all and especially to PMario for advice and solutions. I also highly recommend exiftool, and Phil Harvey was extremely helpful instructing me with that.

I'm glad, it worked!

As Stephan pointed out, I'm sure your workflow will be useful for TW users.
So thanks for the summary!

have fun!
mario 
Reply all
Reply to author
Forward
0 new messages