Iptc utility syntax question


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Iptc utility syntax question
# 1  
Old 05-04-2009
Iptc utility syntax question

I just found and installed David Moore's libiptcdata with its iptc command-line utility. It's about the latter that my question is based.

The usage syntax is : iptc [OPTIONS] [FILE]...
where -m requires an IPTC field name, and -v is the value to assign or modify in that field. This value is a string bounded in double quotes. The thing I'm curious about (and as this little toy was written in 2005 I doubt Mr Moore is at his same email address as the one posted on his SourceForge manual page shows) is as follows:

How would one safely punctuate the value string, say, for a Caption or Special Instructions?

I've already tried an exclamation point, whereupon my bash shell reminded me that's a command in that shell (it noticed it even as it was in dbl-quotes). I suspect, then, that an alternate means of punctuation would have to be used. Having never installed or made any use of anything like this, I'm guessing it would either be the hex corresponding to the punctuation mark one wanted to represent, joined to the rest of the string by ampersand/s, or else an ampersand and another string containing the PM.
I suppose, also, that a hint or clue as to why would be in the C++ code in which this was written. Problem is, I don't know C++ well enough to know what to look for.

Could someone familiar with C++ coding download the libfiles (etc) and try to glean what the safer syntax would be to punctuate these strings [hex or &-signs between strings]?

Thanks for giving this a read.

BZT
# 2  
Old 05-11-2009
Lightbulb Trial and error -- tested tried and true

A little trial and error, and a lot of scanning man, info and by-example Web pages later, I have:

Turns out it will pretty much comply with whatever your shell allows. You just have to format your strings according to the shell's syntax. If you happen to use a punctuation mark that your shell (eg bash) understands intuitively as a command (ye old bang <!> comes racing to mind), and you know how to isolate it/them so they're taken to be part of the string instead of as command shorthand, then this iptc tagger will glom onto that and use it as intended.

So after just now taken three sentences to say what could have been said in just one Smilie I'll try to hunt down the link for downloading it and add it to an edit of this post sometime in the next 48hrs. Barring anything going wrong with my hardware, OS or net-access account.

BZT
# 3  
Old 05-12-2009
Tools Innate flaw in this utility and in Exiv2

Nice to see that folks working at the same problem from two different directions can run into the same brick wall and not know it.

I just ran both the Moore tool and exiv2 on a JPEG where the caption had several line breaks. Both tools ran one line over the other until the output for that particular field was a garbled mess.

Okay, it's likely David Moore has moved on to greener pastures. But what about Exiv2? I presume it's still being maintained and updated. Who should I let know about this (or ask and get their explanations as to why)?

In a way, it's no longer a question of syntax, but more a challenge to the coders in the audience: is it possible to do this thing better?

BZT

PS: The Moore tool is described on (and downloadable from) from this Sourceforge project page.

Last edited by SilversleevesX; 05-12-2009 at 09:46 PM.. Reason: Added link
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question regarding quotation syntax

Hey guys, my first post on UNIX Forums(much overdue IMO)! I've got this bit of code that doesn't seem to be working correctly for an Android app I'm working on: "screen -S gmod1 -p 0 -X stuff " & "" & command.text & "`echo -ne '\015'`""" Basically it types command.text(variable determined... (4 Replies)
Discussion started by: stingwraith
4 Replies

2. UNIX for Dummies Questions & Answers

Make Utility Question

Hello, I'm a recent convert to UNIX and I'm attempting to understand exactly how the make utility is working under the hood. Now, I understand that each rule has a target, dependencies, and update command, but the thing I'm confused about is exactly how the utility is determining when to... (1 Reply)
Discussion started by: kramer_102
1 Replies

3. Programming

Perl syntax question

Hallo everybody, I have a following problem - I'm doing a map funciont to fill in a HTML table and I want to use some radiobutton groups. Unfortunatelly, they are grouped by names, so I have to add some "counter" that will divide one row from another, and I'm using CGI.pm for generating the... (3 Replies)
Discussion started by: duskos
3 Replies

4. Shell Programming and Scripting

Question about syntax error

first of all.. sorry about all the question bombing.. im bored atm so im currently playing around with sh scripting hehe s = `expr ls -s Documents | grep Music | awk '{ print $1 }' ` t = `expr $t + $s` it give syntax error s not found t not found lol... any idea why? (7 Replies)
Discussion started by: Nick1097
7 Replies

5. UNIX for Advanced & Expert Users

SNMP syntax question

Hello, I need to create an snmp.comf file that defines 2 IPs to the same community string. Do I need to have 2 community strings with the same name and diff't IPs? Or should I have 1 string and list the IPs? (comma seperated?) Example: rocommunity EC_8000_RO arguments EC_8000_RO... (2 Replies)
Discussion started by: felbvts
2 Replies

6. UNIX for Dummies Questions & Answers

Piping syntax question

There are are lots of examples of piping output FROM the 'ls' command TO another command, but how does one pipe output TO the 'ls -l' command? For example, use 'which' to find a file, then use 'ls -l' to view the permissions, groups, etc. in a single step: which <filename> | ls -l returns... (4 Replies)
Discussion started by: johne1
4 Replies

7. Shell Programming and Scripting

Question on Find Utility

Hi Guys, Do you know how can I find files with modificatioin time less than 30 MINUTES using the find utility? Or if u have any other mechanism to find it using script, I'll appreciate it. Thanks! (5 Replies)
Discussion started by: marlonus999
5 Replies

8. Shell Programming and Scripting

awk syntax question

Hi there could someone explain what is happening in the following function/statement for me, im just a little confused code = 'BEGIN{FS=","} { printf ("%-11s,%s%s%s,%07.2f,%14s,%-3s\n",$1,substr($2,9,2),substr($2,6,2),substr($ 2,3,2),$9,$10,$12) } this function is called later in the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies
Login or Register to Ask a Question