Skip to content

Commit c8a7ea3

Browse files
committed
OcdFileImport: Reliably detect Registration black
Mapper is unable to detect Registration black in absence of spot colors. This patch fixes the defect, loosens the name matching criterion and aligns the matching criteria along the supported OCD format versions.
1 parent 7036522 commit c8a7ea3

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/fileformats/ocd_file_import.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,12 @@ void OcdFileImport::importColors(const OcdFile<Ocd::FormatV8>& file)
503503
}
504504
color->setKnockout(color_info.overprint != 0);
505505

506-
if ((i == 0 && color->isBlack() && color->getName() == QLatin1String("Registration black"))
507-
|| (!components.empty() && components.size() == num_separations
508-
&& color_info.cmyk.cyan == 200
506+
if ((color->isBlack() && color->getName().startsWith(QLatin1String("Registration black")))
507+
|| (color_info.cmyk.cyan == 200
509508
&& color_info.cmyk.magenta == 200
510509
&& color_info.cmyk.yellow == 200
511510
&& color_info.cmyk.black == 200
511+
&& components.size() == num_separations
512512
&& std::all_of(color_info.separations, color_info.separations + num_separations,
513513
[](const auto& s) { return s == 200; }) ) )
514514
{
@@ -710,12 +710,12 @@ void OcdFileImport::importColor(const QString& param_string)
710710
if (!number_ok)
711711
return;
712712

713-
if ((cmyk.isBlack() && name == QLatin1String("Registration black"))
714-
|| (!components.empty() && components.size() == spot_colors.size()
715-
&& qFuzzyCompare(cmyk.c, 1)
713+
if ((cmyk.isBlack() && name.startsWith(QLatin1String("Registration black")))
714+
|| (qFuzzyCompare(cmyk.c, 1)
716715
&& qFuzzyCompare(cmyk.m, 1)
717716
&& qFuzzyCompare(cmyk.y, 1)
718717
&& qFuzzyCompare(cmyk.k, 1)
718+
&& components.size() == spot_colors.size()
719719
&& std::all_of(begin(components), end(components),
720720
[](const auto& c) { return qFuzzyCompare(c.factor, 1); }) ) )
721721
{

test/file_format_t.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,6 @@ void FileFormatTest::colorTest()
14121412
// the target file format.
14131413
for (auto i = 0; i < original->getNumColorPrios(); ++i)
14141414
{
1415-
// >>>>>>>>> Temporary handling of OCD defects
1416-
if (*format_id == 'O' && i == 0 && original->getColorByPrio(0)->getName() != copy->getColorByPrio(0)->getName())
1417-
QEXPECT_FAIL("", "Registration black is not properly detected in absence of spot colors", Continue);
1418-
// <<<<<<<<< Temporary handling of OCD defects
1419-
14201415
// Gratiously handle missing v8 features (opacity, limited name
14211416
// length, CMYK color resolution).
14221417
auto* color_in_original = original->getColorByPrio(i);

0 commit comments

Comments
 (0)