Skip to content

Commit

Permalink
Change error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Mar 6, 2025
1 parent 2480cec commit ffd680f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apps/shared/avifjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion apps/shared/avifpng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ffd680f

Please sign in to comment.