json single object

Started by bruno75, October 12, 2015, 09:16:15 AM

Previous topic - Next topic

bruno75

Hi ,

first thanks for this great tool.

I want to use exiftool with gulp and my issue is the json output format is a collection [{...}], is it possible to generate a json singleton {...} ? how ?

Best regards
Bruno

Phil Harvey

Can't you just remove the leading and trailing square brackets yourself?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bruno75

Hi Phil,

As i use exiftool via gulp plugins (send exifs to elasticsearch), i will be easier if there i
s an option because elastic search don t understand it.

I had the same issue in my previous project , had to made the difference to return between singleton and collection json list ;-)

but if there is no option i ll try getting a work around
and thx for your great tool
Bruno

Phil Harvey

Hi Bruno,

Yes, sorry.  There is no ExifTool option to do what you want.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Hayo Baan

Can you tweak the command that is run? If so, you could pipe it through e.g., sed and replace the strings. For instance, like so: exiftool blah blah blah | sed 's/\[{/{/;s/}\]/}/'. Note: I'm assuming there is really only one item in the  list!
Hayo Baan – Photography
Web: www.hayobaan.nl