ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: bruno75 on October 12, 2015, 09:16:15 AM

Title: json single object
Post by: bruno75 on October 12, 2015, 09:16:15 AM
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
Title: Re: json single object
Post by: Phil Harvey on October 12, 2015, 10:44:59 PM
Can't you just remove the leading and trailing square brackets yourself?

- Phil
Title: Re: json single object
Post by: bruno75 on October 13, 2015, 04:47:53 AM
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
Title: Re: json single object
Post by: Phil Harvey on October 13, 2015, 07:46:12 AM
Hi Bruno,

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

- Phil
Title: Re: json single object
Post by: Hayo Baan on October 13, 2015, 07:55:18 AM
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!