Using Exiftool After Postprocessing the CR3 Files

I use Canon 200D II for photography. For post-processing I use RawTherapee and Gimp on desktop and sometimes snapseed on android. (and a shemless plug, do check out my 500px and instagram profiles if you are interested 😛).

One thing I need to do everytime I upload photos to 500px is to restore the exif to the post-processed file. The main reason behind that is RawTherapee by default does not read the exif info from a .CR3 file which is the Raw file format used by Canon 200D II.

Fortunately, there is (of course an open source) tool to fix it called exiftool.

To install exiftool on fedora,

sudo dnf install perl-Image-ExifTool

To read exif data using exiftool

$ exiftool ../IMG_3711.CR3
ExifTool Version Number         : 12.42
File Name                       : IMG_3711.CR3
Directory                       : ..
File Size                       : 18 MB
File Modification Date/Time     : 2023:02:09 10:32:54+05:30
File Access Date/Time           : 2023:02:12 15:15:44+05:30
File Inode Change Date/Time     : 2023:02:09 12:36:32+05:30
File Permissions                : -rw-r--r--
File Type                       : CR3
File Type Extension             : cr3
MIME Type                       : image/x-canon-cr3
Major Brand                     : Canon Raw (.CRX)
Minor Version                   : 0.0.1
Compatible Brands               : crx , isom
Compressor Version              : CanonCR3_001/00.09.00/00.00.00
Image Width                     : 6000
Image Height                    : 4000
Bits Per Sample                 : 8 8 8
Compression                     : JPEG (old-style)
Make                            : Canon
Camera Model Name               : Canon EOS 200D II
Orientation                     : Horizontal (normal)
Resolution Unit                 : inches
Artist                          : GIRISH JOSHI
Copyright                       : 
Exposure Time                   : 1/250
F Number                        : 5.0
Exposure Program                : Manual
ISO                             : 400
Sensitivity Type                : Recommended Exposure Index
Recommended Exposure Index      : 400
Exif Version                    : 0231
Date/Time Original              : 2023:02:09 10:32:54
Offset Time                     : +05:30
Offset Time Original            : +05:30
Offset Time Digitized           : +05:30
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/256
Aperture Value                  : 5.0
Flash                           : No Flash
Focal Length                    : 135.0 mm
User Comment                    : 
Sub Sec Time                    : 06
Sub Sec Time Original           : 06
Sub Sec Time Digitized          : 06
Flashpix Version                : 0100
Exif Image Width                : 6000
Exif Image Height               : 4000
Focal Plane X Resolution        : 6825.938567
Focal Plane Y Resolution        : 6825.938567
Focal Plane Resolution Unit     : inches
Custom Rendered                 : Normal
Exposure Mode                   : Manual
Scene Capture Type              : Standard
Serial Number                   : 258273007186
Lens Info                       : 55-250mm f/0
Lens Serial Number              : 00003b0d05
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : CRAW
Canon Flash Mode                : Off
Continuous Drive                : Continuous
Focus Mode                      : AF + MF
Record Mode                     : CR3
Canon Image Size                : n/a
Easy Mode                       : Manual
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Metering Mode                   : Spot
Focus Range                     : Auto
Canon Exposure Mode             : Manual
Lens Type                       : Canon EF-S 55-250mm f/4-5.6 IS STM
Max Focal Length                : 250 mm
Min Focal Length                : 55 mm
Focal Units                     : 1/mm
Max Aperture                    : 5.2
Min Aperture                    : 29
Flash Activity                  : 0
Flash Bits                      : E-TTL
Focus Continuous                : Continuous
Image Stabilization             : On (2)
Zoom Source Width               : 0
Zoom Target Width               : 0
Manual Flash Output             : n/a
Color Tone                      : Normal
SRAW Quality                    : n/a
Auto ISO                        : 100
Base ISO                        : 400
Measured EV                     : 12.62
Target Aperture                 : 5
Target Exposure Time            : 1/256
Exposure Compensation           : 0
White Balance                   : Shade
Slow Shutter                    : None
Shot Number In Continuous Burst : 0
Optical Zoom Code               : n/a
Camera Temperature              : 31 C
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Measured EV 2                   : 24
Bulb Duration                   : 0
Camera Type                     : EOS High-end
Auto Rotate                     : None
ND Filter                       : Off
Canon Image Type                : Canon EOS 200D II
Canon Firmware Version          : Firmware Version 1.0.2
Owner Name                      : 
Canon Model ID                  : EOS SL3 / 250D / Kiss X10
Thumbnail Image Valid Area      : 0 159 6 113
AF Area Mode                    : Spot AF
Num AF Points                   : 143
Valid AF Points                 : 1
Canon Image Width               : 6000
Canon Image Height              : 4000
AF Image Width                  : 6000
AF Image Height                 : 4000
AF Area Widths                  : 320 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
AF Area Heights                 : 320 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
AF Area X Positions             : -1108 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
AF Area Y Positions             : 709 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
AF Points In Focus              : 0
AF Points Selected              : 0
Image Unique ID                 : f929182c79604d5fabc6307a3f2dd44a
Time Zone                       : +05:30
Time Zone City                  : Delhi
Daylight Savings                : Off
Bracket Mode                    : Off
Bracket Value                   : 0
Bracket Shot Number             : 0
Raw Jpg Size                    : Large
WB Bracket Mode                 : Off
WB Bracket Value AB             : 0
WB Bracket Value GM             : 0
Live View Shooting              : On
Focus Distance Upper            : 2.22 m
Focus Distance Lower            : 2 m
Shutter Mode                    : Electronic First Curtain
Flash Exposure Lock             : Off
RF Lens Type                    : n/a
Lens Model                      : EF-S55-250mm f/4-5.6 IS STM
Internal Serial Number          : AG2449652
Dust Removal Data               : (Binary data 1024 bytes, use -b option to extract)
Crop Left Margin                : 0
Crop Right Margin               : 0
Crop Top Margin                 : 0
Crop Bottom Margin              : 0
Exposure Level Increments       : 1/3 Stop
ISO Expansion                   : Off
Safety Shift                    : Disable
Exposure Comp Auto Cancel       : Disable
Mirror Lockup                   : Disable
Viewfinder Warnings             : Monochrome, WB corrected, Noise reduction
Shutter-AE Lock                 : AE/AF, No AE lock
Set Button When Shooting        : Unknown (37 0)
Custom Controls                 : 19 0 19 0 0 255 255 255 3 0 0 255 255 255 18 0 4 0 53 0 25 0 37 0 13 0 14 2 14 2 29 0 29 0 5 0 5 0 5 0 5 0 23 0 0 0 0 0 90 0 29 0 54 0 78 0 87 0 103 0 39 0 105 0 53 0 65535 0 3 5376 3840 0 0 0 0 0 0 0 0 0 0 0 5200 0 0 0 0 0 0 0 0 0 0 7 3 4 31 1 2 3 4 5 1
LCD Display At Power On         : Display
Retract Lens On Power Off       : Enable
Aspect Ratio                    : 3:2
Cropped Image Width             : 6000
Cropped Image Height            : 4000
Cropped Image Left              : 0
Cropped Image Top               : 0
Tone Curve                      : Standard
Sharpness                       : 3
Sharpness Frequency             : n/a
Sensor Red Level                : 0
Sensor Blue Level               : 0
White Balance Red               : 0
White Balance Blue              : 0
Color Temperature               : 5200
Picture Style                   : Portrait
Digital Gain                    : 0
WB Shift AB                     : 0
WB Shift GM                     : 0
Measured RGGB                   : 583 1024 1024 598
Color Space                     : sRGB
VRD Offset                      : 0
Sensor Width                    : 6288
Sensor Height                   : 4056
Sensor Left Border              : 276
Sensor Top Border               : 48
Sensor Right Border             : 6275
Sensor Bottom Border            : 4047
Black Mask Left Border          : 0
Black Mask Top Border           : 0
Black Mask Right Border         : 0
Black Mask Bottom Border        : 0
Picture Style User Def          : Auto; Auto; Auto
Picture Style PC                : None; None; None
Custom Picture Style File Name  : 
AF Micro Adj Mode               : Disable
AF Micro Adj Value              : 0
Peripheral Lighting Setting     : On
Chromatic Aberration Setting    : On
Distortion Correction Setting   : On
Peripheral Illumination Corr    : Off
Auto Lighting Optimizer         : Off
Highlight Tone Priority         : Off
Long Exposure Noise Reduction   : Auto
High ISO Noise Reduction        : Off
Ambience Selection              : Standard
Grainy B/W Filter               : Off
Soft Focus Filter               : Off
Toy Camera Filter               : Off
Miniature Filter                : Off
Miniature Filter Orientation    : Horizontal
Miniature Filter Position       : 0
Miniature Filter Parameter      : 0
Fisheye Filter                  : Off
Painting Filter                 : Off
Watercolor Filter               : Off
HDR                             : Off
HDR Effect                      : Natural
Exif Byte Order                 : Little-endian (Intel, II)
GPS Version ID                  : 2.3.0.0
Thumbnail Image                 : (Binary data 11672 bytes, use -b option to extract)
Movie Header Version            : 0
Create Date                     : 2023:02:09 10:32:54+05:30
Modify Date                     : 2023:02:09 10:32:54+05:30
Time Scale                      : 1
Duration                        : 1.00 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 5
Track Header Version            : 0
Track Create Date               : 2023:02:09 10:32:54+05:30
Track Modify Date               : 2023:02:09 10:32:54+05:30
Track ID                        : 1
Track Duration                  : 1.00 s
Track Layer                     : 0
Track Volume                    : 0.00%
Sample Time                     : 0 s
Sample Duration                 : 1.00 s
Jpg From Raw                    : (Binary data 1791397 bytes, use -b option to extract)
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : CRAW
Source Image Width              : 6288
Source Image Height             : 4056
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Video Frame Rate                : 1
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2023:02:09 10:32:54+05:30
Media Modify Date               : 2023:02:09 10:32:54+05:30
Media Time Scale                : 1
Media Duration                  : 1.00 s
Media Language Code             : eng
Handler Type                    : NRT Metadata
Meta Format                     : CTMD
Time Stamp                      : 2023:02:09 10:32:54.06
Color Data Version              : 18 (EOS RP/250D)
WB RGGB Levels As Shot          : 2175 1024 1024 1444
Color Temp As Shot              : 6981
WB RGGB Levels Auto             : 1792 1024 1024 1742
Color Temp Auto                 : 4806
WB RGGB Levels Measured         : 1792 1024 1024 1742
Color Temp Measured             : 4806
WB RGGB Levels Daylight         : 1883 1024 1024 1659
Color Temp Daylight             : 5200
WB RGGB Levels Shade            : 2175 1024 1024 1444
Color Temp Shade                : 7000
WB RGGB Levels Cloudy           : 2016 1024 1024 1549
Color Temp Cloudy               : 6000
WB RGGB Levels Tungsten         : 1331 1024 1024 2372
Color Temp Tungsten             : 3200
WB RGGB Levels Fluorescent      : 1565 1024 1024 2217
Color Temp Fluorescent          : 3688
WB RGGB Levels Kelvin           : 1883 1024 1024 1659
Color Temp Kelvin               : 5189
WB RGGB Levels Flash            : 2072 1024 1024 1529
Color Temp Flash                : 6272
Per Channel Black Level         : 2048 2048 2049 2048
Normal White Level              : 13035
Specular White Level            : 14338
Linearity Upper Margin          : 10015
Vignetting Corr Version         : 64
Rating                          : 0
Preview Image                   : (Binary data 194968 bytes, use -b option to extract)
Media Data Size                 : 17279376
Media Data Offset               : 284024
Flash Exposure Compensation     : 0
Drive Mode                      : Continuous Shooting
Flash Type                      : Built-In Flash
Lens                            : 55.0 - 250.0 mm
Red Eye Reduction               : Off
Shooting Mode                   : Manual
Shutter Curtain Sync            : 1st-curtain sync
WB RGGB Levels                  : 2175 1024 1024 1444
Aperture                        : 5.0
Blue Balance                    : 1.410156
Image Size                      : 6000x4000
Lens ID                         : Canon EF-S 55-250mm f/4-5.6 IS STM
Megapixels                      : 24.0
Red Balance                     : 2.124023
Scale Factor To 35 mm Equivalent: 1.6
Shutter Speed                   : 1/250
Create Date                     : 2023:02:09 10:32:54.06+05:30
Date/Time Original              : 2023:02:09 10:32:54.06+05:30
Modify Date                     : 2023:02:09 10:32:54.06+05:30
Avg Bitrate                     : 138 Mbps
Rotation                        : 0
Lens                            : 55.0 - 250.0 mm (35 mm equivalent: 88.7 - 403.1 mm)
Circle Of Confusion             : 0.019 mm
Depth Of Field                  : 0.04 m (2.09 - 2.13 m)
Field Of View                   : 9.5 deg
Focal Length                    : 135.0 mm (35 mm equivalent: 217.7 mm)
Hyperfocal Distance             : 195.61 m
Light Value                     : 10.6

Once the post-processing is done, the exif details can be restored to the .jpg file as follows.

$ exiftool -overwrite_original -tagsfromfile <inputfile.CR3> -all:all -tagsfromfile @ -thumbnailimage <outputfile.jpg>

for example

$ exiftool -overwrite_original -tagsfromfile ../IMG_3711.CR3 -all:all -tagsfromfile @ -thumbnailimage IMG_3711.jpg