I've recently found out that you can fetch the `identify -verbose` data in JSON format by doing `convert image.jpg json:`, which is really cool!
Currently I'm fetching EXIF information using `identify -format '%[EXIF:*]'`, since it's much faster than fetching all image data. However, it's not so straightforward to parse the output, because some EXIF data span multiple lines. Is it possible to retrieve only the EXIF data in JSON format?
Extracting EXIF data in JSON format
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Extracting EXIF data in JSON format
I don't think so. However, this is quicker:janko-m wrote:Is it possible to retrieve only the EXIF data in JSON format?
Code: Select all
convert image.jpg[1x1+0+0] json:
snibgo's IM pages: im.snibgo.com
Re: Extracting EXIF data in JSON format
That's a great solution, and it has about the same speed as fetching the EXIF data directly. Thanks!snibgo wrote:I don't think so. However, this is quicker:janko-m wrote:Is it possible to retrieve only the EXIF data in JSON format?Code: Select all
convert image.jpg[1x1+0+0] json:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extracting EXIF data in JSON format
This will write only the EXIF data to a file
Code: Select all
convert DSC_0001.JPG -format "%[EXIF:*]" info: > tmp.json