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
You can use nconvert
, which is freeware (for private and educational use) and available for Win, Linux and Mac.
This tool can rotate JPEG images lossless according to the EXIF orientation tag:
nconvert -jpegtrans exif -o 'rotated_%.jpg' *.jpg
That command will batch convert all JPEG files in the current directory and prepending their names with rotated_
. This is controlled by the -o
option, refer to nconvert -help
for more possibilities:
-o filename : Output filename
Use # to specify position of numeric enumerator
Use % to specify source filename
Use $ to specify full source pathname
Use $$ to specify source folder name
Best Answer
You can use the
-g
option of exiftran:The
-i
option does in-place modification to the file.