Main Menu

linefeed: write and read

Started by Archive, May 12, 2010, 08:54:45 AM

Previous topic - Next topic

Archive

[Originally posted by csweet on 2010-02-24 11:54:52.812019-08]

I am calling exiftool from within Java utilizing the -@ - feature during the writing process.  I have been able to figure out how to insert non-english unicode characters, but I am still stumped on how to insert a LF into a string.  I tried
Code:
'
'
which, of course, gets escaped again into
Code:
'
'

Why do I need to insert LF you migh ask?  To maintain compatibility with Photoshop, which takes a multi-line string and concatenates them together with LF, then putting the string into a single string metadata field.

On the flip side: How do I read a LF from within Java?  It appears that the LF gets converted to a '.' period.

Code:
exiftool  -s -G0:1 -a -n \test.jpg

Extracting non-engligh unicode characters also looks tricky, but have not attempted that one yet.

Archive

[Originally posted by exiftool on 2010-02-24 12:15:40.135829-08]

One way to insert tag value with a linefeed
is to store the value in a file and use the "-TAG<=FILE"
syntax.  There are other techniques you can
use too:  see
this thread


The -b option may be used to output a single
tag without converting the newlines.  Alternatively you
can use the JSON (-j) or XML (-X) output
formats.

Archive

[Originally posted by csweet on 2010-02-24 12:46:05.401486-08]

My system is a multi-threaded batch environment and would like to stay away from creating up to 20 files to write metadata into an image.  I understand that your suggestion is for the current version and does in fact work and will probably use that implementation.

However, I wonder if it would be possible to have the -X switch also work for writing tags that allows the value of a tag to be XML encoded.  This would also allow for unusual characters (e.g. 슩) to be entered via the command line using XML encoding without referencing additional files.

Code:
exiftool -X -Decription=line 1&#xA;line2

Archive

[Originally posted by exiftool on 2010-02-24 12:51:24.083623-08]

Yes, I should have mentioned this.

The -ex option allows you to do exactly that.

- Phil