Skip to content

Commit 94f8889

Browse files
Update olympus tags (#2246) (#2249)
Update translation output of `Exif.OlympusCs.ArtFilter`/`Exif.OlympusCs.MagicFilter`, `Exif.OlympusCs.ImageStabilization` and `Exif.OlympusCs.WhiteBalance` tags. Fix `Exif.OlympusCs.ImageStabilization` type from `unsignedShort` to `unsignedLong`. Closes #2246. Ref: Exiftool Olympus tags and Olympus E-M10 Mark II instuction manual.
1 parent dc4ae73 commit 94f8889

File tree

7 files changed

+276
-62
lines changed

7 files changed

+276
-62
lines changed

src/olympusmn_int.cpp

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ constexpr TagDetails olympusFlashControlMode[] = {{0, N_("Off")}, {3, N_("TTL")}
341341

342342
//! WhiteBalance, tag 0x0500
343343
constexpr TagDetails olympusWhiteBalance[] = {{0, N_("Auto")},
344-
{1, N_("Auto (Keep Warm Color Off")},
344+
{1, N_("Auto (Keep Warm Color Off)")},
345345
{16, N_("7500K (Fine Weather with Shade)")},
346346
{17, N_("6000K (Cloudy)")},
347347
{18, N_("5300K (Fine Weather)")},
@@ -405,12 +405,53 @@ constexpr TagDetails olympusPictureModeBWFilter[] = {{0, N_("n/a")}, {1, N_("
405405
constexpr TagDetails olympusPictureModeTone[] = {{0, N_("n/a")}, {1, N_("Neutral")}, {2, N_("Sepia")},
406406
{3, N_("Blue")}, {4, N_("Purple")}, {5, N_("Green")}};
407407

408+
constexpr TagDetails artFilters[] = {
409+
{0, N_("Off")},
410+
{1, N_("Soft Focus")},
411+
{2, N_("Pop Art")},
412+
{3, N_("Pale & Light Color")},
413+
{4, N_("Light Tone")},
414+
{5, N_("Pin Hole")},
415+
{6, N_("Grainy Film")},
416+
{9, N_("Diorama")},
417+
{10, N_("Cross Process")},
418+
{12, N_("Fish Eye")},
419+
{13, N_("Drawing")},
420+
{14, N_("Gentle Sepia")},
421+
{15, N_("Pale & Light Color II")},
422+
{16, N_("Pop Art II")},
423+
{17, N_("Pin Hole II")},
424+
{18, N_("Pin Hole III")},
425+
{19, N_("Grainy Film II")},
426+
{20, N_("Dramatic Tone")},
427+
{21, N_("Punk")},
428+
{22, N_("Soft Focus 2")},
429+
{23, N_("Sparkle")},
430+
{24, N_("Watercolor")},
431+
{25, N_("Key Line")},
432+
{26, N_("Key Line II")},
433+
{27, N_("Miniature")},
434+
{28, N_("Reflection")},
435+
{29, N_("Fragmented")},
436+
{31, N_("Cross Process II")},
437+
{32, N_("Dramatic Tone II")},
438+
{33, N_("Watercolor I")},
439+
{34, N_("Watercolor II")},
440+
{35, N_("Diorama II")},
441+
{36, N_("Vintage")},
442+
{37, N_("Vintage II")},
443+
{38, N_("Vintage III")},
444+
{39, N_("Partial Color")},
445+
{40, N_("Partial Color II")},
446+
{41, N_("Partial Color III")},
447+
};
448+
408449
//! OlympusCs Quality, tag 0x0603
409450
constexpr TagDetails olympusCsQuality[] = {{1, N_("SQ")}, {2, N_("HQ")}, {3, N_("SHQ")}, {4, N_("RAW")}};
410451

411452
//! Olympus ImageStabilization, tag 0x0604
412-
constexpr TagDetails olympusImageStabilization[] = {
413-
{0, N_("Off")}, {1, N_("On, Mode 1")}, {2, N_("On, Mode 2")}, {3, N_("On, Mode 3")}};
453+
static constexpr TagDetails olympusImageStabilization[] = {
454+
{0, N_("Off")}, {1, N_("S-IS 1")}, {2, N_("S-IS 2")}, {3, N_("S-IS 3")}, {4, N_("S-IS AUTO")}};
414455

415456
constexpr TagInfo OlympusMakerNote::tagInfoCs_[] = {
416457
{0x0000, "CameraSettingsVersion", N_("Camera Settings Version"), N_("Camera settings version"), IfdId::olympusCsId,
@@ -510,7 +551,7 @@ constexpr TagInfo OlympusMakerNote::tagInfoCs_[] = {
510551
{0x0603, "Quality", N_("Image Quality 2"), N_("Image quality 2"), IfdId::olympusCsId, SectionId::makerTags,
511552
unsignedShort, -1, EXV_PRINT_TAG(olympusCsQuality)},
512553
{0x0604, "ImageStabilization", N_("Image Stabilization"), N_("Image stabilization"), IfdId::olympusCsId,
513-
SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(olympusImageStabilization)},
554+
SectionId::makerTags, unsignedLong, -1, EXV_PRINT_TAG(olympusImageStabilization)},
514555
{0x0900, "ManometerPressure", N_("Manometer Pressure"), N_("Manometer pressure"), IfdId::olympusCsId,
515556
SectionId::makerTags, unsignedShort, -1, printValue},
516557
{0x0901, "ManometerReading", N_("Manometer Reading"), N_("Manometer reading"), IfdId::olympusCsId,
@@ -1438,65 +1479,22 @@ std::ostream& OlympusMakerNote::printCs0x0301(std::ostream& os, const Value& val
14381479
} // OlympusMakerNote::printCs0x0301
14391480

14401481
//! OlympusCs ArtFilter, tag 0x0529, OlympusCs MagicFilter, tag 0x052c
1441-
std::ostream& OlympusMakerNote::print0x0529(std::ostream& os, const Value& value, const ExifData*) {
1442-
static struct {
1443-
uint16_t val[2];
1444-
const char* label;
1445-
} artFilters[] = {
1446-
{{0, 0}, N_("Off")},
1447-
{{0, 1280}, N_("Off")},
1448-
{{1, 1280}, N_("Soft Focus")},
1449-
{{2, 1280}, N_("Pop Art")},
1450-
{{3, 1280}, N_("Pale & Light Color")},
1451-
{{4, 1280}, N_("Light Tone")},
1452-
{{5, 1280}, N_("Pin Hole")},
1453-
{{6, 1280}, N_("Grainy Film")},
1454-
{{9, 1280}, N_("Diorama")},
1455-
{{10, 1280}, N_("Cross Process")},
1456-
{{12, 1280}, N_("Fish Eye")},
1457-
{{13, 1280}, N_("Drawing")},
1458-
{{14, 1280}, N_("Gentle Sepia")},
1459-
{{15, 1280}, N_("Pale & Light Color II")},
1460-
{{16, 1280}, N_("Pop Art II")},
1461-
{{17, 1280}, N_("Pin Hole II")},
1462-
{{18, 1280}, N_("Pin Hole III")},
1463-
{{19, 1280}, N_("Grainy Film II")},
1464-
{{20, 1280}, N_("Dramatic Tone")},
1465-
{{21, 1280}, N_("Punk")},
1466-
{{22, 1280}, N_("Soft Focus 2")},
1467-
{{23, 1280}, N_("Sparkle")},
1468-
{{24, 1280}, N_("Watercolor")},
1469-
{{25, 1280}, N_("Key Line")},
1470-
{{26, 1280}, N_("Key Line II")},
1471-
{{27, 1280}, N_("Miniature")},
1472-
{{28, 1280}, N_("Reflection")},
1473-
{{29, 1280}, N_("Fragmented")},
1474-
{{31, 1280}, N_("Cross Process II")},
1475-
{{32, 1280}, N_("Dramatic Tone II")},
1476-
{{33, 1280}, N_("Watercolor I")},
1477-
{{34, 1280}, N_("Watercolor II")},
1478-
{{35, 1280}, N_("Diorama II")},
1479-
{{36, 1280}, N_("Vintage")},
1480-
{{37, 1280}, N_("Vintage II")},
1481-
{{38, 1280}, N_("Vintage III")},
1482-
{{39, 1280}, N_("Partial Color")},
1483-
{{40, 1280}, N_("Partial Color II")},
1484-
{{41, 1280}, N_("Partial Color III")},
1485-
};
1486-
1482+
std::ostream& OlympusMakerNote::print0x0529(std::ostream& os, const Value& value, const ExifData* metadata) {
14871483
if (value.count() != 4 || value.typeId() != unsignedShort) {
1488-
return os << value;
1484+
return os << "(" << value << ")";
14891485
}
14901486

1491-
auto v0 = static_cast<uint16_t>(value.toInt64(0));
1492-
auto v1 = static_cast<uint16_t>(value.toInt64(1));
1487+
const auto v0 = value.toInt64(0);
14931488

1494-
for (auto&& filter : artFilters) {
1495-
if (filter.val[0] == v0 && filter.val[1] == v1) {
1496-
return os << filter.label;
1497-
}
1489+
printTag<std::size(artFilters), artFilters>(os, v0, metadata);
1490+
1491+
if (v0 == 39) { // The "Partial color" option also has a color choice
1492+
const auto v3 = value.toInt64(3);
1493+
os << " (" << _("position") << " " << (v3 + 1) << ")";
1494+
return os;
14981495
}
1499-
return os << "";
1496+
1497+
return os;
15001498
} // OlympusMakerNote::print0x0529
15011499

15021500
// Olympus FocusInfo tag 0x1209 ManualFlash

test/data/issue_2246_poc1.exv

17.8 KB
Binary file not shown.

test/data/test_reference_files/issue_2246_poc1.exv.out

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.

test/data/test_reference_files/olympus-m.zuiko-12-45mm-f4-pro.exv.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Exif.OlympusCs.FlashRemoteControl Short 1 0 Off
7878
Exif.OlympusCs.FlashControlMode Short 4 0 0 0 0 Off
7979
Exif.OlympusCs.FlashIntensity SRational 4 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0
8080
Exif.OlympusCs.ManualFlashStrength SRational 4 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0
81-
Exif.OlympusCs.WhiteBalance Short 1 1 Auto (Keep Warm Color Off
81+
Exif.OlympusCs.WhiteBalance Short 1 1 Auto (Keep Warm Color Off)
8282
Exif.OlympusCs.WhiteBalanceTemperature Short 1 0 0
8383
Exif.OlympusCs.WhiteBalanceBracket SShort 2 0 0 0 0
8484
Exif.OlympusCs.CustomSaturation SShort 3 0 -5 5 0 -5 5
@@ -102,7 +102,7 @@ Exif.OlympusCs.NoiseFilter SShort 3 -2 -2 1 Off
102102
Exif.OlympusCs.ArtFilter Short 4 0 0 0 0 Off
103103
Exif.OlympusCs.DriveMode Short 5 1 1 0 0 0 1 1 0 0 0
104104
Exif.OlympusCs.PanoramaMode Short 2 0 0 0 0
105-
Exif.OlympusCs.ImageStabilization Long 1 4 (4)
105+
Exif.OlympusCs.ImageStabilization Long 1 4 S-IS AUTO
106106
Exif.OlympusCs.ManometerPressure Short 1 0 0
107107
Exif.OlympusCs.ManometerReading SLong 2 -9999 -9999 -9999 -9999
108108
Exif.OlympusCs.ExtendedWBDetect Short 1 0 Off

test/data/test_reference_files/olympus-m.zuiko-17mm-f1.2-pro.exv.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Exif.OlympusCs.NoiseFilter SShort 3 0 -2 1 Standard
103103
Exif.OlympusCs.ArtFilter Short 4 0 0 0 0 Off
104104
Exif.OlympusCs.DriveMode Short 5 5 1 1 0 0 5 1 1 0 0
105105
Exif.OlympusCs.PanoramaMode Short 2 0 0 0 0
106-
Exif.OlympusCs.ImageStabilization Long 1 4 (4)
106+
Exif.OlympusCs.ImageStabilization Long 1 4 S-IS AUTO
107107
Exif.OlympusCs.ManometerPressure Short 1 0 0
108108
Exif.OlympusCs.ManometerReading SLong 2 -9999 -9999 -9999 -9999
109109
Exif.OlympusCs.ExtendedWBDetect Short 1 0 Off

test/data/test_reference_files/test_issue_2126.exv.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Exif.OlympusCs.NoiseFilter SShort 3 -1 -2 1 Low
110110
Exif.OlympusCs.ArtFilter Short 4 0 0 0 0 Off
111111
Exif.OlympusCs.DriveMode Short 6 0 0 0 0 2 17 0 0 0 0 2 17
112112
Exif.OlympusCs.PanoramaMode Short 2 0 0 0 0
113-
Exif.OlympusCs.ImageStabilization Long 1 4 (4)
113+
Exif.OlympusCs.ImageStabilization Long 1 4 S-IS AUTO
114114
Exif.OlympusCs.ManometerPressure Short 1 0 0
115115
Exif.OlympusCs.ManometerReading SLong 2 -9999 -9999 -9999 -9999
116116
Exif.OlympusCs.ExtendedWBDetect Short 1 0 Off
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from system_tests import CaseMeta, path
4+
5+
class OlympusArtFilterPartialColor(metaclass=CaseMeta):
6+
"""
7+
Regression test for the bug described in:
8+
https://github.com/Exiv2/exiv2/issues/2246
9+
"""
10+
url = "https://github.com/Exiv2/exiv2/issues/2246"
11+
12+
filename = path("$data_path/issue_2246_poc1.exv")
13+
commands = ["$exiv2 --Print kyvt --key Exif.OlympusCs.ArtFilter $filename"]
14+
stderr = [""]
15+
stdout = ["""Exif.OlympusCs.ArtFilter Short 39 4352 0 5 Partial Color (position 6)
16+
"""]
17+
retval = [0]

0 commit comments

Comments
 (0)