-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to write \n (newline) to a tag value? #37
Comments
Thanks for the bug report! TIL: ExifTool supports "HTML entity escaping". I've implemented this in version 7.4.0 which I just released. |
Thanks to much, that was amazingly quick! One question, if I may? Please excuse the noob factor, just trying to figure out how this fits together: Say I want to write a string which includes newline character, would this be the correct code? const ExifTool = require('exiftool-vendored').ExifTool
const exiftool = new ExifTool({exiftoolArgs: ['-E', '-stay_open', 'True', '-@', '-']}) // using -E in addition to the default args
exiftool.write('path/to/image.jpg', {'Copyright': 'going
going
gone'})
.then(res => console.log('success', res))
.catch(err => console.error('failure', err)) When I run the above code, and then read the written tag from the CLI: > exiftool -Copyright path/to/image.jpg
Copyright : going
going
gone
> exiftool -Copyright path/to/image.jpg -b
going
going
gone% The value of that tag is the literal string I just wrote, without newline characters. What am I missing? |
Just to make sure it works in the CLI, I confirmed that the following works: > exiftool -E "-Copyright=going
going
gone" path/to/image.jpg
> exiftool -Copyright path/to/image.jpg -b
going
going
gone% (I've double-checked that I'm running [email protected]) |
I also tried this, without any more luck: exiftool.write('path/to/image.jpg', {'Copyright': 'going
going
gone'}, ['-E']) |
Ah. I've read your source code, followed the callstack and I now understand what's going on. With v7.4.0, the The solution was simpler than I thought. Just use the string |
I will now be quite. Thanks for the rubber duck session 👍 |
Fails with a message that the file named "1999" doesn't exist (
Error: File not found - 1999
). How can I use newlines in a tag? Any help appreciated :)The text was updated successfully, but these errors were encountered: