Windows – How to convert JPEG JFIF files to JPEG Exif format

cameraexifjpegwindows 7windows-photo-viewer

I recently put the SD card of my camera in a Windows 7 PC and start browsing pictures on it. I noticed some were not aligned correctly and use rotate feature included in Windows Photo Viewer in order to view them as I wanted.

What I didn't know is that when rotate feature is used, it also overwrite the picture when pressing next or previous button resulting in a possible loss of quality (which is in my opinion a bad idea, app should at least warn user of what will happened when using such a feature).

After that, I re-inserted the SD card back in my camera and bad surprise happened : the rotated picture could not be previewed anymore. Instead, i got a black screen saying "Incompatible JPEG format". Other files (untouched) are still working ok.

To try to understand what happened I opened a JPEG file from camera and one generated on windows 7 in a hex editor. Here is the difference :

The camera JPEG files have a Exif tag in them (with 0xE1 in header). Other JPEG files (Windows 7) have first a JFIF tag in it, followed by a Exif tag (with 0xE0 in header).

So if i understand it well, both are JPEG files, but using a different internal format.

Here is my question : is it possible (using some tool) to convert JFIF files to Exif format ?

I understand that original camera files have been reencoded and thus lose some quality (getting originals back is impossible). What i want know if convert them from JFIF back to Exif (without a second loss of quality if possible…)

Best Answer

The JPEG standard has a number of file compliancy variations which were created for specific reasons, two types which are often used are EXIF and JFIF.

Although both files are classed as JPEG files and appear on a computer with the JPEG extension the difference is due to the supplementary data which is added to the original image during processing in camera or in computer. This data is usually stored in an areas that are called "APPn" (where "n" is the number 0,1,2 etc).

Most imaging software applications can open both types of JPEG file, but most digital cameras can only display EXIF format images. When a EXIF file is opened in an imaging program like Photoshop and then saved, the file is changed into a JFIF format with a result that the image can no longer be opened by the camera and the shooting data is lost.

EXIF

The EXIF format was created for use in digital cameras, the APPn stores information such as the state of the camera when the image was recorded (shutter, aperture white balance etc).

JFIF

The JFIF variation is commonly used in the imaging industry, most software applications save files in this format. JFIF uses the APPn to store information such as copyright and captions (IPTC text) and profile information for colour management (icm data).

You can try ExifTool and run this command, but it is possible that your camera will be unable to display the images, as the shooting data is lost.

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