Skip to content

Commit

Permalink
OM-1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
alextutubalin committed Mar 13, 2022
1 parent fde7ad2 commit adcb898
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions internal/libraw_cameraids.h
Expand Up @@ -157,6 +157,7 @@ it under the terms of the one of two licenses as you choose:
#define OlyID_E_M5_Mark_III OlyID_str2hex("S0089")
#define OlyID_E_M1_Mark_III OlyID_str2hex("S0092")
#define OlyID_E_P7 OlyID_str2hex("S0093")
#define OlyID_OM_1 OlyID_str2hex("S0095")
#define OlyID_C_3030Z OlyID_str2hex("SX351")
#define OlyID_C_5050Z OlyID_str2hex("SX558")
#define OlyID_C_350Z OlyID_str2hex("SX751")
Expand Down
2 changes: 2 additions & 0 deletions libraw/libraw_const.h
Expand Up @@ -362,6 +362,8 @@ enum LibRaw_cameramaker_index
LIBRAW_CAMERAMAKER_HMD_Global,
LIBRAW_CAMERAMAKER_HUAWEI,
LIBRAW_CAMERAMAKER_RaspberryPi,
LIBRAW_CAMERAMAKER_OmDigital,

// Insert additional indexes here
LIBRAW_CAMERAMAKER_TheLastOne
};
Expand Down
8 changes: 6 additions & 2 deletions src/metadata/identify.cpp
Expand Up @@ -42,7 +42,8 @@ static const struct
{LIBRAW_CAMERAMAKER_Nikon, "Nikon"},
{LIBRAW_CAMERAMAKER_Nokia, "Nokia"},
{LIBRAW_CAMERAMAKER_Olympus, "Olympus"},
{LIBRAW_CAMERAMAKER_Ricoh, "Ricoh"},
{LIBRAW_CAMERAMAKER_OmDigital, "OM Digital"},
{LIBRAW_CAMERAMAKER_Ricoh, "Ricoh"},
{LIBRAW_CAMERAMAKER_Pentax, "Pentax"},
{LIBRAW_CAMERAMAKER_PhaseOne, "Phase One"},
{LIBRAW_CAMERAMAKER_PhaseOne, "PhaseOne"},
Expand Down Expand Up @@ -2212,12 +2213,15 @@ void LibRaw::identify_finetune_dcr(char head[64], int fsize, int flen)
if (width == 4080) // Olympus E-PM1, E-PL3, E-P3;
width -= 24;

if (width == 10400) // Olympus PEN-F, E-M1-II, E-M1-III, E-M1X
if (width == 10400) // Olympus PEN-F, E-M1-II, E-M1-III, E-M1X, OM-1
width -= 12;

if (width == 8200) // E-M1-III in 50Mp mode, E-M1X
width -= 30;

if (width == 8180) // OM-1 in 50Mp
width -= 10;

if (width == 9280) { // Olympus E-M5 Mark II;
width -= 6;
height -= 6;
Expand Down
10 changes: 6 additions & 4 deletions src/metadata/makernotes.cpp
Expand Up @@ -116,7 +116,7 @@ void LibRaw::parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
uchar *table_buf_0x940e;
ushort table_buf_0x940e_len = 0;

if (!strcmp(buf, "OLYMPUS") || !strcmp(buf, "PENTAX ") ||
if (!strcmp(buf, "OLYMPUS") || !strcmp(buf, "PENTAX ") || !strncmp(buf,"OM SYS",6)||
(!strncmp(make, "SAMSUNG", 7) && (dng_writer == CameraDNG)))
{
base = ftell(ifp) - 10;
Expand Down Expand Up @@ -176,7 +176,7 @@ void LibRaw::parse_makernote_0xc634(int base, int uptag, unsigned dng_writer)
is_Sony = 1;

if (!is_Olympus &&
(!strncmp(make, "OLYMPUS", 7) ||
(!strncmp(make, "OLYMPUS", 7) || !strncmp(make, "OM Digi", 7) ||
(!strncasecmp(make, "CLAUSS", 6) && !strncasecmp(model, "piX 5oo", 7)))) {
is_Olympus = 1;
OlympusDNG_SubDirOffsetValid =
Expand Down Expand Up @@ -433,11 +433,13 @@ void LibRaw::parse_makernote(int base, int uptag)
goto quit;
}

if (!strcmp(buf, "OLYMPUS") ||
if (!strcmp(buf, "OLYMPUS") || !strncmp(buf, "OM SYS",6) ||
!strcmp(buf, "PENTAX "))
{
base = ftell(ifp) - 10;
fseek(ifp, -2, SEEK_CUR);
if (buf[1] == 'M')
get4();
order = get2();
if (buf[0] == 'O')
get2();
Expand Down Expand Up @@ -484,7 +486,7 @@ void LibRaw::parse_makernote(int base, int uptag)
}

if (!is_Olympus &&
(!strncasecmp(make, "Olympus", 7) ||
(!strncasecmp(make, "Olympus", 7) || !strncmp(make, "OM Digi", 7) ||
(!strncasecmp(make, "CLAUSS", 6) && !strncasecmp(model, "piX 5oo", 7)))) {
is_Olympus = 1;
}
Expand Down
7 changes: 5 additions & 2 deletions src/metadata/normalize_model.cpp
Expand Up @@ -600,10 +600,13 @@ void LibRaw::GetNormalizedModel()
{
setMakeFromIndex(LIBRAW_CAMERAMAKER_Sony);
}
else if (makeIs(LIBRAW_CAMERAMAKER_OmDigital))
{
setMakeFromIndex(LIBRAW_CAMERAMAKER_Olympus);
}
else if (makeIs(LIBRAW_CAMERAMAKER_Clauss) && (OlyID == OlyID_E_M10_Mark_II))
{
setMakeFromIndex(LIBRAW_CAMERAMAKER_Olympus);

} else if (makeIs(LIBRAW_CAMERAMAKER_Canon) &&
(!strncmp(model, "EOS D2000", 9) || // don't use unique_id here
!strncmp(model, "EOS D6000", 9) || // because ids for Monochrome models are unknown
Expand Down Expand Up @@ -1420,7 +1423,7 @@ void LibRaw::SetStandardIlluminants (unsigned makerIdx, const char* normModel) {
int c;
if (!icWBC[LIBRAW_WBI_Ill_A][0] &&
!icWBC[LIBRAW_WBI_D65][0]) {
if (makerIdx == LIBRAW_CAMERAMAKER_Olympus) {
if (makerIdx == LIBRAW_CAMERAMAKER_Olympus ) {
while (++i, icWBCCTC[i][0]) {
if (icWBCCTC[i][0] == 3000)
FORC4 icWBC[LIBRAW_WBI_Ill_A][c] = icWBCCTC[i][c+1];
Expand Down
4 changes: 2 additions & 2 deletions src/metadata/tiff.cpp
Expand Up @@ -1881,7 +1881,7 @@ void LibRaw::apply_tiff()
filters = 0;
break;
}
if ((!strncmp(make, "OLYMPUS", 7) ||
if ((!strncmp(make, "OLYMPUS", 7) || !strncmp(make, "OM Digi", 7) ||
(!strncasecmp(make, "CLAUSS", 6) &&
!strncasecmp(model, "piX 5oo", 7))) && // 0x5330303539 works here
(INT64(tiff_ifd[raw].bytes) * 2ULL ==
Expand Down Expand Up @@ -1913,7 +1913,7 @@ void LibRaw::apply_tiff()
load_flags = 0;
case 16:
load_raw = &LibRaw::unpacked_load_raw;
if ((!strncmp(make, "OLYMPUS", 7) ||
if ((!strncmp(make, "OLYMPUS", 7) || !strncmp(make, "OM Digi", 7) ||
(!strncasecmp(make, "CLAUSS", 6) &&
!strncasecmp(model, "piX 5oo", 7))) && // 0x5330303539 works here
(INT64(tiff_ifd[raw].bytes) * 7ULL >
Expand Down
1 change: 1 addition & 0 deletions src/tables/cameralist.cpp
Expand Up @@ -834,6 +834,7 @@ static const char *static_camera_list[] = {
"Olympus XZ-1",
"Olympus XZ-2",
"Olympus XZ-10",
"OM Digital OM-1",
"OmniVision 4688",
"OmniVision OV5647",
"OmniVision OV5648",
Expand Down
3 changes: 3 additions & 0 deletions src/tables/colordata.cpp
Expand Up @@ -1144,6 +1144,9 @@ int LibRaw::adobe_coeff(unsigned make_idx, const char *t_model,
{ LIBRAW_CAMERAMAKER_Olympus, "XZ-2", 0, 0,
{ 9777,-3483,-925,-2886,11297,1800,-602,1663,5134 } },

{ LIBRAW_CAMERAMAKER_Olympus, "OM-1", 0, 0,
{ 9488, -3984, -714, -2887, 10945, 2229, -137, 960, 5786 } },

{ LIBRAW_CAMERAMAKER_OmniVison, "", 16, 0x3ff,
{ 12782,-4059,-379,-478,9066,1413,1340,1513,5176 } }, /* DJC */

Expand Down

4 comments on commit adcb898

@sarunasb
Copy link

@sarunasb sarunasb commented on adcb898 Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a more consistent use of:
"OM Digital Solutions" — for manufacturer;
"OM System" — make, brand. This is what OMDS use on packaging, user manual, folder names on SD card etc. Also vendors use "OM System", where they used "Olympus".

"OM Digital" is not used anywhere.

@LibRaw
Copy link
Owner

@LibRaw LibRaw commented on adcb898 Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIF: Make = OM Digital Solutions

OK, we'll update cameralist.cpp sometime in the future

@sarunasb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more data point, dmesg after USB connection:

[Tue Apr  5 13:57:13 2022] usb 3-1.2: new high-speed USB device number 7 using xhci_hcd
[Tue Apr  5 13:57:13 2022] usb 3-1.2: New USB device found, idVendor=33a2, idProduct=012e, bcdDevice= 1.00
[Tue Apr  5 13:57:13 2022] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Apr  5 13:57:13 2022] usb 3-1.2: Product: OM-1
[Tue Apr  5 13:57:13 2022] usb 3-1.2: Manufacturer: OMSYSTEM
[Tue Apr  5 13:57:13 2022] usb 3-1.2: SerialNumber: BJMA03234
[Tue Apr  5 13:57:13 2022] usb-storage 3-1.2:1.0: USB Mass Storage device detected
[Tue Apr  5 13:57:13 2022] scsi host12: usb-storage 3-1.2:1.0
[Tue Apr  5 13:57:14 2022] scsi 12:0:0:0: Direct-Access     OMSYSTEM OM-1             1.00 PQ: 0 ANSI: 2
[Tue Apr  5 13:57:14 2022] scsi 12:0:0:1: Direct-Access     OMSYSTEM OM-1             1.00 PQ: 0 ANSI: 2

@LibRaw
Copy link
Owner

@LibRaw LibRaw commented on adcb898 Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LibRaw is not about USB.

But some apps using LibRaw checks EXIF Make/Model against LibRaw's cameralist, so it is better if cameralist match EXIF

Please sign in to comment.