Panasonic G9, rawspeed and cropping

Hello. Any rawspeed developers here?

Here’s the thing: Since I’ve got my Lumix G9, I keep dealing with raw crop issues. Normally the crop is set to [0, 0, 58, 0], and that usually works zoomed out. Zooming in reveals tiny artifacts:

image

But then there are also issues with hi-res and burst modes, and these are more obvious as the crop needs to be tighter by about 8 pixels on the top and the bottom side.

I can deal with that manually in the hi-res mode because usually you don’t take much of these pictures. But in burst it’s a different story. You basically take hundreds of photos and these all may need to be fixed manually too (depending on your workflow). Also, I can fix that manually only if I set a property which is hidden and not available to the user by default.

So far I was unable to figure out the correct mode in the cameras.xml file. Is there even any “burst” or “hi-res” value available?

Here comes the blasphemy: Is it even correct trying to dump manufacturer’s intentions, and come up with custom crops? Because from what I can see here it only brings problems.

Yes, that’s my topic. Now I see that the burst mode is affected as well.

Ah, OK, now I see what the mode actually is:

std::string Rw2Decoder::guessMode() const {
  float ratio = 3.0F / 2.0F; // Default

  if (!mRaw->isAllocated())
    return "";

  ratio = static_cast<float>(mRaw->dim.x) / static_cast<float>(mRaw->dim.y);

  float min_diff = fabs(ratio - 16.0F / 9.0F);
  std::string closest_match = "16:9";

  float t = fabs(ratio - 3.0F / 2.0F);
  if (t < min_diff) {
    closest_match = "3:2";
    min_diff = t;
  }

  t = fabs(ratio - 4.0F / 3.0F);
  if (t < min_diff) {
    closest_match = "4:3";
    min_diff = t;
  }

  t = fabs(ratio - 1.0F);
  if (t < min_diff) {
    closest_match = "1:1";
    min_diff = t;
  }
  writeLog(DEBUG_PRIO::EXTRA, "Mode guess: '%s'", closest_match.c_str());
  return closest_match;
}

So basically the code takes the image dimensions and creates a mode value based on their ratio. But clearly there’s more in the EXIF metadata to be taken into account.

1 Like

So far I’ve come to a conclusion, that it’s nearly impossible to decide on crop mode statically just based on some flags in the raw file metadata. One would have to know the camera VERY WELL in order to put the camera.xml entries together. Consider this:

I have two images here. Both were taken only seconds apart, same size, same subject… But I’ve probably changed some shooting mode parameters.
P1293436.RW2 (23.0 MB)

     - ExifTool Version Number         : 12.40
     - File Name                       : P1293436.RW2
     - Directory                       : .
     - File Size                       : 23 MiB
     - File Modification Date/Time     : 2023:05:08 17:55:34+02:00
     - File Access Date/Time           : 2023:05:10 21:19:20+02:00
     - File Inode Change Date/Time     : 2023:05:08 21:11:04+02:00
     - File Permissions                : -rwxrwxrwx
     - File Type                       : RW2
     - File Type Extension             : rw2
     - MIME Type                       : image/x-panasonic-rw2
     - Exif Byte Order                 : Little-endian (Intel, II)
0x0001 Panasonic Raw Version           : 0390
0x0002 Sensor Width                    : 5264
0x0003 Sensor Height                   : 3912
0x0004 Sensor Top Border               : 12
0x0005 Sensor Left Border              : 18
0x0006 Sensor Bottom Border            : 3900
0x0007 Sensor Right Border             : 5202
0x0008 Samples Per Pixel               : 1
0x0009 CFA Pattern                     : [Red,Green][Green,Blue]
0x000a Bits Per Sample                 : 12
0x000b Compression                     : Panasonic RAW 1
0x000e Linearity Limit Red             : 4095
0x000f Linearity Limit Green           : 4095
0x0010 Linearity Limit Blue            : 4095
0x0017 ISO                             : 200
0x0018 High ISO Multiplier Red         : 1
0x0019 High ISO Multiplier Green       : 1
0x001a High ISO Multiplier Blue        : 1
0x001b Noise Reduction Params          : 5 100 4 4 4 200 8 8 8 400 16 16 16 800 32 32 32 1600 64 64 64
0x001c Black Level Red                 : 128
0x001d Black Level Green               : 128
0x001e Black Level Blue                : 128
0x0024 WB Red Level                    : 578
0x0025 WB Green Level                  : 256
0x0026 WB Blue Level                   : 505
0x0000 Num WB Entries                  : 7
0x0001 WB Type 1                       : Fine Weather
0x0002 WB RGB Levels 1                 : 580 256 502
0x0005 WB Type 2                       : Cloudy
0x0006 WB RGB Levels 2                 : 618 256 468
0x0009 WB Type 3                       : Shade
0x000a WB RGB Levels 3                 : 655 256 442
0x000d WB Type 4                       : Tungsten (Incandescent)
0x000e WB RGB Levels 4                 : 409 256 763
0x0011 WB Type 5                       : Flash
0x0012 WB RGB Levels 5                 : 590 256 484
0x0015 WB Type 6                       : D55
0x0016 WB RGB Levels 6                 : 550 256 512
0x0019 WB Type 7                       : ISO Studio Tungsten
0x001a WB RGB Levels 7                 : 409 256 763
0x002d Raw Format                      : 4
0x011a X Resolution                    : 180
0x011b Y Resolution                    : 180
0x0128 Resolution Unit                 : inches
0x0131 Software                        : Ver.2.7
0x0132 Modify Date                     : 2023:05:08 17:55:34
0x0213 Y Cb Cr Positioning             : Co-sited
0x8830 Sensitivity Type                : Standard Output Sensitivity
0x8831 Standard Output Sensitivity     : 200
0x9010 Offset Time                     : +02:00
0x9101 Components Configuration        : Y, Cb, Cr, -
0x9102 Compressed Bits Per Pixel       : 2
0x9208 Light Source                    : Unknown
0x0001 Image Quality                   : RAW
0x0002 Firmware Version                : 0.2.7.0
0x0003 White Balance                   : Unknown (20)
0x0007 Focus Mode                      : AF-C
0x000f AF Area Mode                    : 1-area
0x001a Image Stabilization             : Dual2 IS
0x001c Macro Mode                      : Off
0x001f Shooting Mode                   : Aperture Priority
0x0020 Audio                           : No
0x0021 Data Dump                       : (Binary data 24584 bytes, use -b option to extract)
0x0024 Flash Bias                      : 0
0x0025 Internal Serial Number          : (XEL) 2022:05:13 no. 0063
0x0026 Panasonic Exif Version          : 0415
0x0028 Color Effect                    : Off
0x0029 Time Since Power On             : 00:09:24.87
0x002a Burst Mode                      : On
0x002b Sequence Number                 : 9
0x002c Contrast Mode                   : Low
0x002d Noise Reduction                 : -5
0x002e Self Timer                      : Off (0)
0x0030 Rotation                        : Horizontal (normal)
0x0031 AF Assist Lamp                  : Enabled but Not Used
0x0034 Optical Zoom Mode               : Standard
0x0035 Conversion Lens                 : Off
0x0036 Travel Day                      : n/a
0x0038 Battery Level                   : Low
0x003a World Time Location             : Home
0x003d Advanced Scene Type             : 1
0x0043 JPEG Quality                    : Standard
0x0044 Color Temp Kelvin               : 5400
0x0045 Bracket Settings                : No Bracket
0x0046 WB Shift AB                     : 0
0x0047 WB Shift GM                     : 0
0x0048 Flash Curtain                   : n/a
0x0049 Long Exposure Noise Reduction   : Off
0x004b Panasonic Image Width           : 5184
0x004c Panasonic Image Height          : 3888
0x004d AF Point Position               : 0.41 0.26
0x0000 Num Face Positions              : 0
0x0052 Lens Serial Number              : 17111000144
0x0053 Accessory Type                  : NO-ACCESSORY
0x0054 Accessory Serial Number         : 0000000
0x0060 Lens Firmware Version           : 0.1.2.0
0x0000 Faces Recognized                : 0
0x0065 Title                           : 
0x0066 Baby Name                       : 
0x0067 Location                        : 
0x0069 Country                         : 
0x006b State                           : 
0x006d City                            : 
0x006f Landmark                        : 
0x0070 Intelligent Resolution          : Off
0x0076 HDR Shot                        : Off
0x0077 Burst Speed                     : 60
0x0079 Intelligent D-Range             : Off
0x007c Clear Retouch                   : Off
0x0080 City 2                          : 
0x0089 Photo Style                     : Standard or Custom
0x008a Shading Compensation            : Off
0x008b WB Shift Intelligent Auto       : 0
0x008c Accelerometer Z                 : 255
0x008d Accelerometer X                 : 8
0x008e Accelerometer Y                 : 18
0x008f Camera Orientation              : Normal
0x0090 Roll Angle                      : 1.7
0x0091 Pitch Angle                     : -4
0x0092 WB Shift Creative Control       : 0
0x0093 Sweep Panorama Direction        : Off
0x0094 Sweep Panorama Field Of View    : 0
0x0096 Timer Recording                 : Off
0x009d Internal ND Filter              : 0
0x009e HDR                             : Off
0x009f Shutter Type                    : Electronic
0x00a1 Filter Effect                   : Expressive
0x00a3 Clear Retouch Value             : undef
0x00ab Touch AE                        : Off
0x00ac Monochrome Filter Effect        : Off
0x00ad Highlight Shadow                : 0 0
0x00af Time Stamp                      : 2023:05:08 15:55:34
0x00b3 Video Burst Resolution          : Off or 4K
0x00b4 Multi Exposure                  : Off
0x00b9 Red Eye Removal                 : Off
0x00bb Video Burst Mode                : Off
0x00bc Diffraction Correction          : Off
0x00bd Focus Bracket                   : 0
0x00be Long Exposure NR Used           : Yes
0x00bf Post Focus Merging              : Post Focus Auto Merging or None
0x00c1 Video Preburst                  : No
0x00ca Sensor Type                     : Standard
0x00d2 Monochrome Grain Effect         : Off
0x0000 Panasonic Date Time             : 2023:05:08 17:55:33.67
0x0010 Time Lapse Shot Number          : 8
0x8000 Maker Note Version              : 0155
0x8001 Scene Mode                      : Off
0x8002 Highlight Warning               : No
0x8003 Dark Focus Environment          : No
0x8009 Text Stamp                      : Off
0x8010 Baby Age                        : (not set)
0x9290 Sub Sec Time                    : 216
0xa000 Flashpix Version                : 0100
0xa001 Color Space                     : sRGB
0xa002 Exif Image Width                : 1920
0xa003 Exif Image Height               : 1440
0x0001 Interoperability Index          : R98 - DCF basic file (sRGB)
0x0002 Interoperability Version        : 0100
0xa217 Sensing Method                  : One-chip color area
0xa301 Scene Type                      : Directly photographed
0xa401 Custom Rendered                 : Custom
0xa402 Exposure Mode                   : Auto
0xa404 Digital Zoom Ratio              : 0
0xa406 Scene Capture Type              : Standard
0xa407 Gain Control                    : Low gain up
0xa408 Contrast                        : Normal
0xa409 Saturation                      : Normal
0xa40a Sharpness                       : Normal
     - PrintIM Version                 : 0250
0x0201 Thumbnail Offset                : 34816
0x0202 Thumbnail Length                : 7232
     - Encoding Process                : Baseline DCT, Huffman coding
     - Color Components                : 3
     - Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
0x002e Jpg From Raw                    : (Binary data 556763 bytes, use -b option to extract)
0x002f Crop Top                        : 12
0x0030 Crop Left                       : 18
0x0031 Crop Bottom                     : 3900
0x0032 Crop Right                      : 5202
0x010f Make                            : Panasonic
0x0110 Camera Model Name               : DC-G9
0x0111 Strip Offsets                   : 4294967295
0x0116 Rows Per Strip                  : 3912
0x0117 Strip Byte Counts               : 23543808
0x0118 Raw Data Offset                 : 561664
0x0002 Distortion Param 02             : 0
0x0004 Distortion Param 04             : 0
0x0005 Distortion Scale                : 1
0x0007 Distortion Correction           : Off
0x0008 Distortion Param 08             : 0
0x0009 Distortion Param 09             : 0
0x000b Distortion Param 11             : 0
0x011c Gamma                           : 2.29296875
0x1001 Multishot On                    : No
0x1100 Focus Step Near                 : 25
0x1101 Focus Step Count                : 2165
0x1102 Flash Fired                     : No
0x1105 Zoom Position                   : 205
0x1200 Lens Attached                   : Yes
0x1201 Lens Type Make                  : 2
0x1202 Lens Type Model                 : 32 10
0x1203 Focal Length In 35mm Format     : 516 mm
0x1301 Aperture Value                  : 7.1
0x1302 Shutter Speed Value             : 1/223
0x1303 Sensitivity Value               : 1
0x1412 Faces Detected                  : No
0x3200 WB CFA0 Level Daylight          : 2305
0x3201 WB CFA1 Level Daylight          : 1024
0x3202 WB CFA2 Level Daylight          : 1024
0x3203 WB CFA3 Level Daylight          : 2013
0x3300 White Balance Set               : Unknown (28)
0x3420 WB Red Level Auto               : 2315
0x3421 WB Blue Level Auto              : 2023
0x3501 Orientation                     : Horizontal (normal)
0x3600 White Balance Detected          : Custom#4
0x0121 Multishot                       : Off
     - About                           : uuid:d874e788-25f8-4d1d-947a-6e77822b5d6a
     - Rating                          : 0
0x829a Exposure Time                   : 1/200
0x829d F Number                        : 7.1
0x8822 Exposure Program                : Aperture-priority AE
0x9000 Exif Version                    : 0231
0x9003 Date/Time Original              : 2023:05:08 17:55:34
0x9004 Create Date                     : 2023:05:08 17:55:34
0x9011 Offset Time Original            : +02:00
0x9012 Offset Time Digitized           : +02:00
0x9204 Exposure Compensation           : +0.66
0x9205 Max Aperture Value              : 5.4
0x9207 Metering Mode                   : Multi-segment
0x9209 Flash                           : Off, Did not fire
0x920a Focal Length                    : 258.0 mm
0x9291 Sub Sec Time Original           : 216
0x9292 Sub Sec Time Digitized          : 216
0xa300 File Source                     : Digital Camera
     - Aperture                        : 7.1
     - Blue Balance                    : 1.972656
     - Red Balance                     : 2.257813
     - Shutter Speed                   : 1/200
     - Create Date                     : 2023:05:08 17:55:34.216+02:00
     - Date/Time Original              : 2023:05:08 17:55:34.216+02:00
     - Modify Date                     : 2023:05:08 17:55:34.216+02:00
     - Thumbnail Image                 : (Binary data 7232 bytes, use -b option to extract)
     - Lens Type                       : Lumix G Vario 100-300mm F4.0-5.6 II
     - Advanced Scene Mode             : Off
     - Image Height                    : 3888
     - Image Width                     : 5184
     - Image Size                      : 5184x3888
     - Lens ID                         : Lumix G Vario 100-300mm F4.0-5.6 II
     - Light Value                     : 12.3
     - Megapixels                      : 20.2
     - Scale Factor To 35 mm Equivalent: 2.0
     - Circle Of Confusion             : 0.015 mm
     - Field Of View                   : 4.0 deg
     - Focal Length                    : 258.0 mm (35 mm equivalent: 516.0 mm)
     - Hyperfocal Distance             : 624.05 m

P1293437.RW2 (23.0 MB)

     - ExifTool Version Number         : 12.40
     - File Name                       : P1293437.RW2
     - Directory                       : .
     - File Size                       : 23 MiB
     - File Modification Date/Time     : 2023:05:08 17:55:49+02:00
     - File Access Date/Time           : 2023:05:10 21:19:20+02:00
     - File Inode Change Date/Time     : 2023:05:08 21:11:02+02:00
     - File Permissions                : -rwxrwxrwx
     - File Type                       : RW2
     - File Type Extension             : rw2
     - MIME Type                       : image/x-panasonic-rw2
     - Exif Byte Order                 : Little-endian (Intel, II)
0x0001 Panasonic Raw Version           : 0390
0x0002 Sensor Width                    : 5264
0x0003 Sensor Height                   : 3904
0x0004 Sensor Top Border               : 8
0x0005 Sensor Left Border              : 12
0x0006 Sensor Bottom Border            : 3896
0x0007 Sensor Right Border             : 5196
0x0008 Samples Per Pixel               : 1
0x0009 CFA Pattern                     : [Red,Green][Green,Blue]
0x000a Bits Per Sample                 : 12
0x000b Compression                     : Panasonic RAW 1
0x000e Linearity Limit Red             : 4095
0x000f Linearity Limit Green           : 4095
0x0010 Linearity Limit Blue            : 4095
0x0017 ISO                             : 800
0x0018 High ISO Multiplier Red         : 1
0x0019 High ISO Multiplier Green       : 1
0x001a High ISO Multiplier Blue        : 1
0x001b Noise Reduction Params          : 5 100 4 4 4 200 8 8 8 400 16 16 16 800 32 32 32 1600 64 64 64
0x001c Black Level Red                 : 129
0x001d Black Level Green               : 130
0x001e Black Level Blue                : 129
0x0024 WB Red Level                    : 578
0x0025 WB Green Level                  : 256
0x0026 WB Blue Level                   : 506
0x0000 Num WB Entries                  : 7
0x0001 WB Type 1                       : Fine Weather
0x0002 WB RGB Levels 1                 : 580 256 502
0x0005 WB Type 2                       : Cloudy
0x0006 WB RGB Levels 2                 : 618 256 468
0x0009 WB Type 3                       : Shade
0x000a WB RGB Levels 3                 : 655 256 442
0x000d WB Type 4                       : Tungsten (Incandescent)
0x000e WB RGB Levels 4                 : 409 256 763
0x0011 WB Type 5                       : Flash
0x0012 WB RGB Levels 5                 : 590 256 484
0x0015 WB Type 6                       : D55
0x0016 WB RGB Levels 6                 : 550 256 512
0x0019 WB Type 7                       : ISO Studio Tungsten
0x001a WB RGB Levels 7                 : 409 256 763
0x002d Raw Format                      : 4
0x011a X Resolution                    : 180
0x011b Y Resolution                    : 180
0x0128 Resolution Unit                 : inches
0x0131 Software                        : Ver.2.7
0x0132 Modify Date                     : 2023:05:08 17:55:49
0x0213 Y Cb Cr Positioning             : Co-sited
0x8830 Sensitivity Type                : Standard Output Sensitivity
0x8831 Standard Output Sensitivity     : 800
0x9010 Offset Time                     : +02:00
0x9101 Components Configuration        : Y, Cb, Cr, -
0x9102 Compressed Bits Per Pixel       : 2
0x9208 Light Source                    : Unknown
0x0001 Image Quality                   : RAW
0x0002 Firmware Version                : 0.2.7.0
0x0003 White Balance                   : Unknown (20)
0x0007 Focus Mode                      : AF-C
0x000f AF Area Mode                    : 1-area
0x001a Image Stabilization             : Dual2 IS
0x001c Macro Mode                      : Off
0x001f Shooting Mode                   : Aperture Priority
0x0020 Audio                           : No
0x0021 Data Dump                       : (Binary data 24584 bytes, use -b option to extract)
0x0024 Flash Bias                      : 0
0x0025 Internal Serial Number          : (XEL) 2022:05:13 no. 0063
0x0026 Panasonic Exif Version          : 0415
0x0028 Color Effect                    : Off
0x0029 Time Since Power On             : 00:09:44.01
0x002a Burst Mode                      : On
0x002b Sequence Number                 : 1
0x002c Contrast Mode                   : Low
0x002d Noise Reduction                 : -5
0x002e Self Timer                      : Off (0)
0x0030 Rotation                        : Horizontal (normal)
0x0031 AF Assist Lamp                  : Enabled but Not Used
0x0034 Optical Zoom Mode               : Standard
0x0035 Conversion Lens                 : Off
0x0036 Travel Day                      : n/a
0x0038 Battery Level                   : Low
0x003a World Time Location             : Home
0x003d Advanced Scene Type             : 1
0x0043 JPEG Quality                    : Standard
0x0044 Color Temp Kelvin               : 5400
0x0045 Bracket Settings                : No Bracket
0x0046 WB Shift AB                     : 0
0x0047 WB Shift GM                     : 0
0x0048 Flash Curtain                   : n/a
0x0049 Long Exposure Noise Reduction   : On
0x004b Panasonic Image Width           : 5184
0x004c Panasonic Image Height          : 3888
0x004d AF Point Position               : 0.41 0.26
0x0000 Num Face Positions              : 1
0x0001 Face 1 Position                 : 258 57 23 23
0x0052 Lens Serial Number              : 17111000144
0x0053 Accessory Type                  : NO-ACCESSORY
0x0054 Accessory Serial Number         : 0000000
0x0060 Lens Firmware Version           : 0.1.2.0
0x0000 Faces Recognized                : 0
0x0065 Title                           : 
0x0066 Baby Name                       : 
0x0067 Location                        : 
0x0069 Country                         : 
0x006b State                           : 
0x006d City                            : 
0x006f Landmark                        : 
0x0070 Intelligent Resolution          : Off
0x0076 HDR Shot                        : Off
0x0077 Burst Speed                     : 12
0x0079 Intelligent D-Range             : Off
0x007c Clear Retouch                   : Off
0x0080 City 2                          : 
0x0089 Photo Style                     : Standard or Custom
0x008a Shading Compensation            : Off
0x008b WB Shift Intelligent Auto       : 0
0x008c Accelerometer Z                 : 254
0x008d Accelerometer X                 : 3
0x008e Accelerometer Y                 : 17
0x008f Camera Orientation              : Normal
0x0090 Roll Angle                      : 0.6
0x0091 Pitch Angle                     : -3.9
0x0092 WB Shift Creative Control       : 0
0x0093 Sweep Panorama Direction        : Off
0x0094 Sweep Panorama Field Of View    : 0
0x0096 Timer Recording                 : Off
0x009d Internal ND Filter              : 0
0x009e HDR                             : Off
0x009f Shutter Type                    : Mechanical
0x00a1 Filter Effect                   : Expressive
0x00a3 Clear Retouch Value             : undef
0x00ab Touch AE                        : Off
0x00ac Monochrome Filter Effect        : Off
0x00ad Highlight Shadow                : 0 0
0x00af Time Stamp                      : 2023:05:08 15:55:49
0x00b3 Video Burst Resolution          : Off or 4K
0x00b4 Multi Exposure                  : Off
0x00b9 Red Eye Removal                 : Off
0x00bb Video Burst Mode                : Off
0x00bc Diffraction Correction          : Off
0x00bd Focus Bracket                   : 0
0x00be Long Exposure NR Used           : Yes
0x00bf Post Focus Merging              : Post Focus Auto Merging or None
0x00c1 Video Preburst                  : No
0x00ca Sensor Type                     : Standard
0x00d2 Monochrome Grain Effect         : Off
0x0000 Panasonic Date Time             : 2023:05:08 17:55:49.96
0x0010 Time Lapse Shot Number          : 0
0x8000 Maker Note Version              : 0155
0x8001 Scene Mode                      : Off
0x8002 Highlight Warning               : No
0x8003 Dark Focus Environment          : No
0x8009 Text Stamp                      : Off
0x8010 Baby Age                        : (not set)
0x9290 Sub Sec Time                    : 968
0xa000 Flashpix Version                : 0100
0xa001 Color Space                     : sRGB
0xa002 Exif Image Width                : 1920
0xa003 Exif Image Height               : 1440
0x0001 Interoperability Index          : R98 - DCF basic file (sRGB)
0x0002 Interoperability Version        : 0100
0xa217 Sensing Method                  : One-chip color area
0xa301 Scene Type                      : Directly photographed
0xa401 Custom Rendered                 : Custom
0xa402 Exposure Mode                   : Auto
0xa404 Digital Zoom Ratio              : 0
0xa406 Scene Capture Type              : Standard
0xa407 Gain Control                    : High gain up
0xa408 Contrast                        : Normal
0xa409 Saturation                      : Normal
0xa40a Sharpness                       : Normal
     - PrintIM Version                 : 0250
0x0201 Thumbnail Offset                : 34816
0x0202 Thumbnail Length                : 7454
     - Encoding Process                : Baseline DCT, Huffman coding
     - Color Components                : 3
     - Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
0x002e Jpg From Raw                    : (Binary data 601272 bytes, use -b option to extract)
0x002f Crop Top                        : 8
0x0030 Crop Left                       : 12
0x0031 Crop Bottom                     : 3896
0x0032 Crop Right                      : 5196
0x010f Make                            : Panasonic
0x0110 Camera Model Name               : DC-G9
0x0111 Strip Offsets                   : 4294967295
0x0116 Rows Per Strip                  : 3904
0x0117 Strip Byte Counts               : 23494656
0x0118 Raw Data Offset                 : 606208
0x0002 Distortion Param 02             : 0
0x0004 Distortion Param 04             : 0
0x0005 Distortion Scale                : 1
0x0007 Distortion Correction           : Off
0x0008 Distortion Param 08             : 0
0x0009 Distortion Param 09             : 0
0x000b Distortion Param 11             : 0
0x011c Gamma                           : 2.29296875
0x1001 Multishot On                    : No
0x1100 Focus Step Near                 : 25
0x1101 Focus Step Count                : 2077
0x1102 Flash Fired                     : No
0x1105 Zoom Position                   : 205
0x1200 Lens Attached                   : Yes
0x1201 Lens Type Make                  : 2
0x1202 Lens Type Model                 : 32 10
0x1203 Focal Length In 35mm Format     : 516 mm
0x1301 Aperture Value                  : 7.1
0x1302 Shutter Speed Value             : 1/644
0x1303 Sensitivity Value               : 2.9296875
0x1412 Faces Detected                  : Yes
0x3200 WB CFA0 Level Daylight          : 2203
0x3201 WB CFA1 Level Daylight          : 1024
0x3202 WB CFA2 Level Daylight          : 1024
0x3203 WB CFA3 Level Daylight          : 2048
0x3300 White Balance Set               : Unknown (28)
0x3420 WB Red Level Auto               : 2312
0x3421 WB Blue Level Auto              : 2025
0x3501 Orientation                     : Horizontal (normal)
0x3600 White Balance Detected          : Daylight
0x0121 Multishot                       : Off
     - About                           : uuid:d874e788-25f8-4d1d-947a-6e77822b5d6a
     - Rating                          : 0
0x829a Exposure Time                   : 1/640
0x829d F Number                        : 7.1
0x8822 Exposure Program                : Aperture-priority AE
0x9000 Exif Version                    : 0231
0x9003 Date/Time Original              : 2023:05:08 17:55:49
0x9004 Create Date                     : 2023:05:08 17:55:49
0x9011 Offset Time Original            : +02:00
0x9012 Offset Time Digitized           : +02:00
0x9204 Exposure Compensation           : +0.66
0x9205 Max Aperture Value              : 5.4
0x9207 Metering Mode                   : Multi-segment
0x9209 Flash                           : Off, Did not fire
0x920a Focal Length                    : 258.0 mm
0x9291 Sub Sec Time Original           : 968
0x9292 Sub Sec Time Digitized          : 968
0xa300 File Source                     : Digital Camera
     - Aperture                        : 7.1
     - Blue Balance                    : 1.976563
     - Red Balance                     : 2.257813
     - Shutter Speed                   : 1/640
     - Create Date                     : 2023:05:08 17:55:49.968+02:00
     - Date/Time Original              : 2023:05:08 17:55:49.968+02:00
     - Modify Date                     : 2023:05:08 17:55:49.968+02:00
     - Thumbnail Image                 : (Binary data 7454 bytes, use -b option to extract)
     - Lens Type                       : Lumix G Vario 100-300mm F4.0-5.6 II
     - Advanced Scene Mode             : Off
     - Image Height                    : 3888
     - Image Width                     : 5184
     - Image Size                      : 5184x3888
     - Lens ID                         : Lumix G Vario 100-300mm F4.0-5.6 II
     - Light Value                     : 12.0
     - Megapixels                      : 20.2
     - Scale Factor To 35 mm Equivalent: 2.0
     - Circle Of Confusion             : 0.015 mm
     - Field Of View                   : 4.0 deg
     - Focal Length                    : 258.0 mm (35 mm equivalent: 516.0 mm)
     - Hyperfocal Distance             : 624.05 m

And here’s the diff:

2c2
<      - File Name                       : P1293436.RW2
---
>      - File Name                       : P1293437.RW2
5c5
<      - File Modification Date/Time     : 2023:05:08 17:55:34+02:00
---
>      - File Modification Date/Time     : 2023:05:08 17:55:49+02:00
7c7
<      - File Inode Change Date/Time     : 2023:05:08 21:11:04+02:00
---
>      - File Inode Change Date/Time     : 2023:05:08 21:11:02+02:00
15,19c15,19
< 0x0003 Sensor Height                   : 3912
< 0x0004 Sensor Top Border               : 12
< 0x0005 Sensor Left Border              : 18
< 0x0006 Sensor Bottom Border            : 3900
< 0x0007 Sensor Right Border             : 5202
---
> 0x0003 Sensor Height                   : 3904
> 0x0004 Sensor Top Border               : 8
> 0x0005 Sensor Left Border              : 12
> 0x0006 Sensor Bottom Border            : 3896
> 0x0007 Sensor Right Border             : 5196
27c27
< 0x0017 ISO                             : 200
---
> 0x0017 ISO                             : 800
32,34c32,34
< 0x001c Black Level Red                 : 128
< 0x001d Black Level Green               : 128
< 0x001e Black Level Blue                : 128
---
> 0x001c Black Level Red                 : 129
> 0x001d Black Level Green               : 130
> 0x001e Black Level Blue                : 129
37c37
< 0x0026 WB Blue Level                   : 505
---
> 0x0026 WB Blue Level                   : 506
58c58
< 0x0132 Modify Date                     : 2023:05:08 17:55:34
---
> 0x0132 Modify Date                     : 2023:05:08 17:55:49
61c61
< 0x8831 Standard Output Sensitivity     : 200
---
> 0x8831 Standard Output Sensitivity     : 800
80c80
< 0x0029 Time Since Power On             : 00:09:24.87
---
> 0x0029 Time Since Power On             : 00:09:44.01
82c82
< 0x002b Sequence Number                 : 9
---
> 0x002b Sequence Number                 : 1
100c100
< 0x0049 Long Exposure Noise Reduction   : Off
---
> 0x0049 Long Exposure Noise Reduction   : On
104c104,105
< 0x0000 Num Face Positions              : 0
---
> 0x0000 Num Face Positions              : 1
> 0x0001 Face 1 Position                 : 258 57 23 23
119c120
< 0x0077 Burst Speed                     : 60
---
> 0x0077 Burst Speed                     : 12
126,128c127,129
< 0x008c Accelerometer Z                 : 255
< 0x008d Accelerometer X                 : 8
< 0x008e Accelerometer Y                 : 18
---
> 0x008c Accelerometer Z                 : 254
> 0x008d Accelerometer X                 : 3
> 0x008e Accelerometer Y                 : 17
130,131c131,132
< 0x0090 Roll Angle                      : 1.7
< 0x0091 Pitch Angle                     : -4
---
> 0x0090 Roll Angle                      : 0.6
> 0x0091 Pitch Angle                     : -3.9
138c139
< 0x009f Shutter Type                    : Electronic
---
> 0x009f Shutter Type                    : Mechanical
144c145
< 0x00af Time Stamp                      : 2023:05:08 15:55:34
---
> 0x00af Time Stamp                      : 2023:05:08 15:55:49
156,157c157,158
< 0x0000 Panasonic Date Time             : 2023:05:08 17:55:33.67
< 0x0010 Time Lapse Shot Number          : 8
---
> 0x0000 Panasonic Date Time             : 2023:05:08 17:55:49.96
> 0x0010 Time Lapse Shot Number          : 0
164c165
< 0x9290 Sub Sec Time                    : 216
---
> 0x9290 Sub Sec Time                    : 968
177c178
< 0xa407 Gain Control                    : Low gain up
---
> 0xa407 Gain Control                    : High gain up
183c184
< 0x0202 Thumbnail Length                : 7232
---
> 0x0202 Thumbnail Length                : 7454
187,191c188,192
< 0x002e Jpg From Raw                    : (Binary data 556763 bytes, use -b option to extract)
< 0x002f Crop Top                        : 12
< 0x0030 Crop Left                       : 18
< 0x0031 Crop Bottom                     : 3900
< 0x0032 Crop Right                      : 5202
---
> 0x002e Jpg From Raw                    : (Binary data 601272 bytes, use -b option to extract)
> 0x002f Crop Top                        : 8
> 0x0030 Crop Left                       : 12
> 0x0031 Crop Bottom                     : 3896
> 0x0032 Crop Right                      : 5196
195,197c196,198
< 0x0116 Rows Per Strip                  : 3912
< 0x0117 Strip Byte Counts               : 23543808
< 0x0118 Raw Data Offset                 : 561664
---
> 0x0116 Rows Per Strip                  : 3904
> 0x0117 Strip Byte Counts               : 23494656
> 0x0118 Raw Data Offset                 : 606208
208c209
< 0x1101 Focus Step Count                : 2165
---
> 0x1101 Focus Step Count                : 2077
216,219c217,220
< 0x1302 Shutter Speed Value             : 1/223
< 0x1303 Sensitivity Value               : 1
< 0x1412 Faces Detected                  : No
< 0x3200 WB CFA0 Level Daylight          : 2305
---
> 0x1302 Shutter Speed Value             : 1/644
> 0x1303 Sensitivity Value               : 2.9296875
> 0x1412 Faces Detected                  : Yes
> 0x3200 WB CFA0 Level Daylight          : 2203
222c223
< 0x3203 WB CFA3 Level Daylight          : 2013
---
> 0x3203 WB CFA3 Level Daylight          : 2048
224,225c225,226
< 0x3420 WB Red Level Auto               : 2315
< 0x3421 WB Blue Level Auto              : 2023
---
> 0x3420 WB Red Level Auto               : 2312
> 0x3421 WB Blue Level Auto              : 2025
227c228
< 0x3600 White Balance Detected          : Custom#4
---
> 0x3600 White Balance Detected          : Daylight
231c232
< 0x829a Exposure Time                   : 1/200
---
> 0x829a Exposure Time                   : 1/640
235,236c236,237
< 0x9003 Date/Time Original              : 2023:05:08 17:55:34
< 0x9004 Create Date                     : 2023:05:08 17:55:34
---
> 0x9003 Date/Time Original              : 2023:05:08 17:55:49
> 0x9004 Create Date                     : 2023:05:08 17:55:49
244,245c245,246
< 0x9291 Sub Sec Time Original           : 216
< 0x9292 Sub Sec Time Digitized          : 216
---
> 0x9291 Sub Sec Time Original           : 968
> 0x9292 Sub Sec Time Digitized          : 968
248c249
<      - Blue Balance                    : 1.972656
---
>      - Blue Balance                    : 1.976563
250,254c251,255
<      - Shutter Speed                   : 1/200
<      - Create Date                     : 2023:05:08 17:55:34.216+02:00
<      - Date/Time Original              : 2023:05:08 17:55:34.216+02:00
<      - Modify Date                     : 2023:05:08 17:55:34.216+02:00
<      - Thumbnail Image                 : (Binary data 7232 bytes, use -b option to extract)
---
>      - Shutter Speed                   : 1/640
>      - Create Date                     : 2023:05:08 17:55:49.968+02:00
>      - Date/Time Original              : 2023:05:08 17:55:49.968+02:00
>      - Modify Date                     : 2023:05:08 17:55:49.968+02:00
>      - Thumbnail Image                 : (Binary data 7454 bytes, use -b option to extract)
261c262
<      - Light Value                     : 12.3
---
>      - Light Value                     : 12.0

Now how does the rawspeed developer get to know which crop mode to choose unless they have the camera in their hands, shooting using all the modes available, and making notes? Well, they don’t!

All that just to figure out the sensor crop, which I could easily extract from the very image metadata instead. That’s mad.

I’ve prepared a draft PR for rawspeed here: Crop Panasonic G9 images using vendor metadata by jsmucr · Pull Request #490 · darktable-org/rawspeed · GitHub
It builds but at this point I’m unable to test it, as I have zero knowledge of the project and its integration to DT.

Clone the darktable repo. Rawspeed is a submodule. Go into the rawspeed git repo and pull your changes. Run dt’s build script.

2 Likes

Ok, it worked with DT 4.2.1 which I still use, so now let’s just hope it gets merged.

1 Like