Skip to content

Commit 4d26dfe

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 469a4b0 commit 4d26dfe

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
{
@@ -705,12 +705,12 @@ void OcdFileImport::importColor(const QString& param_string)
705705
if (!number_ok)
706706
return;
707707

708-
if ((cmyk.isBlack() && name == QLatin1String("Registration black"))
709-
|| (!components.empty() && components.size() == spot_colors.size()
710-
&& qFuzzyCompare(cmyk.c, 1)
708+
if ((cmyk.isBlack() && name.startsWith(QLatin1String("Registration black")))
709+
|| (qFuzzyCompare(cmyk.c, 1)
711710
&& qFuzzyCompare(cmyk.m, 1)
712711
&& qFuzzyCompare(cmyk.y, 1)
713712
&& qFuzzyCompare(cmyk.k, 1)
713+
&& components.size() == spot_colors.size()
714714
&& std::all_of(begin(components), end(components),
715715
[](const auto& c) { return qFuzzyCompare(c.factor, 1); }) ) )
716716
{

test/file_format_t.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,11 +1273,6 @@ void FileFormatTest::colorTest()
12731273
// the target file format.
12741274
for (auto i = 0; i < original->getNumColorPrios(); ++i)
12751275
{
1276-
// >>>>>>>>> Temporary handling of OCD defects
1277-
if (*format_id == 'O' && i == 0 && original->getColorByPrio(0)->getName() != copy->getColorByPrio(0)->getName())
1278-
QEXPECT_FAIL("", "Registration black is not properly detected in absence of spot colors", Continue);
1279-
// <<<<<<<<< Temporary handling of OCD defects
1280-
12811276
// Gratiously handle missing v8 features (opacity, limited name
12821277
// length, CMYK color resolution).
12831278
auto* color_in_original = original->getColorByPrio(i);

0 commit comments

Comments
 (0)