D
D
devAston2019-09-20 15:12:22
PHP
devAston, 2019-09-20 15:12:22

How to resolve "ColorspaceColorProfileMismatch 'icc'" conflict when generating an image?

Good day, dear $user!
There is a source file in "in.png" PNG format with sRGB scheme.
Must be converted to "TIFF" with CMYK scheme and FOGRA27 profile.
When running the script, an exception arrives " ColorspaceColorProfileMismatch `icc' @ error/profile.c/ProfileImage/866 "
What is my mistake?

The code

$inFile = in.png
$outFile = out.tiff

        $base = new Imagick($inFile);
        $base->transformImageColorspace(Imagick::COLORSPACE_CMYK);
        $base->mergeImageLayers( Imagick::LAYERMETHOD_MERGE);
        $base->profileImage('icc', Storage::disk('local')->url('icc_profile/forga27.icc'));
        $base->setImageUnits(1);
        $base->setImageResolution(127,127);
        $base->setCompression(11);
        $base->setImageFormat("tiff");
        $base->writeImage($outFile);
        $base->destroy();

Thank you for attention...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
devAston, 2019-09-20
@devAston

Instead of Storage::disk('local')->get('icc_profile/fogra27.icc') I passed url ( Storage::disk('local')->url('icc_profile/forga27.icc') )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question