ExifTool Forum

ExifTool => Developers => Topic started by: ludde_t on February 18, 2023, 07:08:18 AM

Title: -json and -jpgfromraw
Post by: ludde_t on February 18, 2023, 07:08:18 AM
Hi,
Trying to get exiftool to both extract -jpgfromraw and -json exif output in the same command but I am failing miserably. Is it possible?
Thanks!
Title: Re: -json and -jpgfromraw
Post by: ludde_t on February 18, 2023, 07:09:24 AM
To clarify the goal is not having to run exiftool twice on the same image to both extract the preview and get the exif-data...
Title: Re: -json and -jpgfromraw
Post by: Phil Harvey on February 18, 2023, 07:38:38 AM
All you need to do is add the -b option.

- Phil
Title: Re: -json and -jpgfromraw
Post by: ludde_t on February 18, 2023, 07:46:48 AM
Thanks for the reply!
exiftool -json -b -jpgfromraw test.nef > test.jpg
Successfully generates the preview-jpg but does not output the json as
exiftool -json test.nef. does

What am I doing wrong? Want to capture the json to parse it with PHP and add it to a db..
Title: Re: -json and -jpgfromraw
Post by: Phil Harvey on February 18, 2023, 08:09:46 AM
Remove the -jpgfromraw to extract all tags.

- Phil
Title: Re: -json and -jpgfromraw
Post by: ludde_t on February 18, 2023, 08:19:54 AM
Thanks, but the end goal is to do both? Trying to avoid doing both
exiftool-b -jpgfromraw test.nef > test.jpg
exiftool -json test.nef

But achieving the same result? E.g parsing the json and getting a preview-jpeg outputted to a file..?
Title: Re: -json and -jpgfromraw
Post by: Phil Harvey on February 18, 2023, 09:31:22 AM
This command extracts both:

exiftool -json -b test.nef

but you'll have to write the JpgFromRaw to file yourself (after decoding from base64, which should be easy).

- Phil
Title: Re: -json and -jpgfromraw
Post by: ludde_t on February 18, 2023, 02:58:07 PM
Thanks! Finally figured it out. Was easy when i figured the base64 was prefixed.. :)
Title: Re: -json and -jpgfromraw
Post by: Phil Harvey on February 19, 2023, 09:20:09 AM
Glad you figured it out.

- Phil