From ffd680f3710972ed7425e9ff71df7291ecda9b44 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Thu, 6 Mar 2025 11:46:21 +0100 Subject: [PATCH] Change error message. --- apps/shared/avifjpeg.c | 4 +++- apps/shared/avifpng.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/shared/avifjpeg.c b/apps/shared/avifjpeg.c index b657baaaac..09bfb64e2c 100644 --- a/apps/shared/avifjpeg.c +++ b/apps/shared/avifjpeg.c @@ -910,7 +910,9 @@ static avifBool avifJPEGReadInternal(FILE * f, if (read_icc_profile(&cinfo, &iccDataTmp, &iccDataLen)) { iccData = iccDataTmp; if (requestedFormat == AVIF_PIXEL_FORMAT_YUV400) { - fprintf(stderr, "The RGB ICC profile is asked to be kept while the output image is gray.\n"); + fprintf(stderr, + "The image contains an RGB ICC profile which is incompatible with the requested output " + "format YUV400 (grayscale). Pass --ignore-icc to discard the ICC profile.\n"); goto cleanup; } if (avifImageSetProfileICC(avif, iccDataTmp, (size_t)iccDataLen) != AVIF_RESULT_OK) { diff --git a/apps/shared/avifpng.c b/apps/shared/avifpng.c index 25fb3c5932..9727ea908f 100644 --- a/apps/shared/avifpng.c +++ b/apps/shared/avifpng.c @@ -367,7 +367,9 @@ avifBool avifPNGRead(const char * inputFilename, if (png_get_iCCP(png, info, &iccpProfileName, &iccpCompression, &iccpData, &iccpDataLen) == PNG_INFO_iCCP) { if (rawColorType != PNG_COLOR_TYPE_GRAY && rawColorType != PNG_COLOR_TYPE_GRAY_ALPHA && avif->yuvFormat == AVIF_PIXEL_FORMAT_YUV400) { - fprintf(stderr, "The RGB ICC profile is asked to be kept while the output image is gray.\n"); + fprintf(stderr, + "The image contains an RGB ICC profile which is incompatible with the requested output " + "format YUV400 (grayscale). Pass --ignore-icc to discard the ICC profile.\n"); goto cleanup; } if (avifImageSetProfileICC(avif, iccpData, iccpDataLen) != AVIF_RESULT_OK) {