How do I convert JFIF tags to EXIF?

Started by joakimsle, June 06, 2010, 05:23:37 AM

Previous topic - Next topic

joakimsle

Hi,

I've read the documentation and searched in the forum, but have still not understood how to do the following:

I have a lot of pictures taken with my old Olympus Digital Camera (late 1990's I think).
When running exiftool on the jpg files I can see a lot of metadata:
Date/time
Exposure
Etc.
The tag format seems to be JFIF Version 1.02.

However, none of my newer photo applications read JFIF metadata and therefore I want to update the files with EXIF tags instead, converting as much information as possible from the old files.

Is there an easy way to "convert" the JFIF information to EXIF information in batch? (most important is to keep date/timestamp)

Any advice would be greatly appreciated.

Best Regards,
Joakim

Phil Harvey

The only useful JFIF tags are the X/YResolution and thumbnail image.

The following command copies these to EXIF:

exiftool "-exif:all<jfif:all" "-thumbnailimage<jfif:thumbnailimage" FILE

- 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 ($).

joakimsle

Hi,

Thank you very much for your quick reply. Using your code, I was able to get the resolution of my pictures to show in my applications. However, I'm still missing a lot of data (most importantly the original date/time) that is available in the file, but will not show up in iPhoto, Preview, JustLooking etc. on my mac.

If I use exiftool on my picture, I can see the information below. Do you mean that the additional information (to the resolution) is stored in another format than JFIF? How do I then convert it to general EXIF format, so I can see the information in my applications? (Date/Time, Shutter speed, Exposure Time etc.)

Thanks again for the quick reply

Regards,
Joakim


Macintosh:temp joakim$ exiftool PIC00003.jpg
ExifTool Version Number         : 8.20
File Name                       : PIC00003.jpg
Directory                       : .
File Size                       : 37 kB
File Modification Date/Time     : 2008:10:19 18:26:30+02:00
File Permissions                : rwx------
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.02
Resolution Unit                 : inches
X Resolution                    : 144
Y Resolution                    : 144
Thumbnail Image                 : (Binary data 2755 bytes, use -b option to extract)
Date/Time Original              : 2001:04:28 15:48:26
Exposure Time                   : 1/30
Flash                           : On
Resolution                      : 1
Protect                         : 0
Camera Type                     : SR35
Serial Number                   : #00000001
Version                         : v35-73
ID                              : OLYMPUS DIGITAL CAMERA
Tag P                           : 2361
QF                              : 71
Rg                              : 270
Gg                              : 128
Bg                              : 192
Ag                              : 0
F Sadj                          : 114
Pic Len                         : 34536
Thm Len                         : 2773
S0                              : 27622
S1                              : 33129
S2                              : 995
S3                              : 33129
S4                              : 1401
S5                              : 33129
S6                              : 33129
S7                              : 1484
S8                              : 0
S9                              : 1484
Sa                              : 64
Sb                              : 27593
Sc                              : 7372
Sd                              : 98
Se                              : 1a201a4
Sf                              : 19a01a1
Sg                              : 19e01a2
Sh                              : 1a10035
T0                              : 2738
T1                              : 5
T2                              : 9
T3                              : 117000
T4                              : 186
T5                              : 33129
Image Width                     : 512
Image Height                    : 384
Encoding Process              : Baseline DCT, Huffman coding
Bits Per Sample                : 8
Color Components             : 3
Y Cb Cr Sub Sampling        : YCbCr4:2:2 (2 1)
Image Size                      : 512x384
Shutter Speed                  : 1/30

Phil Harvey

If you could use the -a -g1 options when extracting information I could tell where the information was stored.  I'm guessing it is in APP12 PictureInfo metdata, but I can't be sure because I don't have a sample image from your camera.

Better yet, if you could upload an original sample from your camera as an attachment I could add it to my collection (and give you much more informed advice).

What Olympus model is it?

- 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 ($).

joakimsle

Hi,

Thanks for all your help. I've attached a sample file. Please let me know if you need any more.

I think the model is an Olympus D-300L. I sold the camera many years ago, but am almost 100% certain from the pictures.

Many thanks in advance,
Joakim

Phil Harvey

Hi Joakim,

Yes, the information is in the APP12 PictureInfo.  I would recommend this command for these images:

exiftool "-exif:all<all" "-thumbnailimage" -make=Olympus -model=D-300L DIR

This will copy the JFIF resolution tags and thumbnail, and the APP12 DateTimeOriginal and ExposureTime to EXIF as well as setting the Make/Model for all images in directory DIR.  The only other tag I can see which might be useful is the APP12 Flash tag.  But unfortunately the values of "Off" and "On" don't map directly into EXIF Flash values.  I will see about adding the ability to convert these values in the next ExifTool release.

- 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 ($).