{"record":{"id":"35a2db0459b92ce8","repo":"DrKLO/Telegram","slug":"s-no-icc-profile-data-in-jpeg-file-n","errorCode":null,"errorMessage":"%s: no ICC profile data in JPEG file\\n","messagePattern":"(.+?): no ICC profile data in JPEG file\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"TMessagesProj/jni/mozjpeg/djpeg.c","lineNumber":795,"sourceCode":"    JOCTET *icc_profile;\n    unsigned int icc_len;\n\n    if ((icc_file = fopen(icc_filename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, icc_filename);\n      exit(EXIT_FAILURE);\n    }\n    if (jpeg_read_icc_profile(&cinfo, &icc_profile, &icc_len)) {\n      if (fwrite(icc_profile, icc_len, 1, icc_file) < 1) {\n        fprintf(stderr, \"%s: can't read ICC profile from %s\\n\", progname,\n                icc_filename);\n        free(icc_profile);\n        fclose(icc_file);\n        exit(EXIT_FAILURE);\n      }\n      free(icc_profile);\n      fclose(icc_file);\n    } else if (cinfo.err->msg_code != JWRN_BOGUS_ICC)\n      fprintf(stderr, \"%s: no ICC profile data in JPEG file\\n\", progname);\n  }\n\n  /* Finish decompression and release memory.\n   * I must do it in this order because output module has allocated memory\n   * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.\n   */\n  (*dest_mgr->finish_output) (&cinfo, dest_mgr);\n  (void)jpeg_finish_decompress(&cinfo);\n  jpeg_destroy_decompress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr)&cinfo);","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/djpeg.c#L777-L813","documentation":"The JPEG contains no usable ICC profile: jpeg_read_icc_profile() returned false and the error code is not JWRN_BOGUS_ICC. Unlike the other djpeg ICC errors this is a plain fprintf (no exit); djpeg continues and still produces image output. It is informational.","triggerScenarios":"Passing -icc <path> on a JPEG that has no APP2 ICC marker at all, or whose marker data does not parse as a valid profile but is not flagged as 'bogus'. The file is created but left empty (note: the fclose for the no-profile branch is not shown here).","commonSituations":"Decoding sRGB JPEGs without embedded ICC, JPEGs stripped of metadata by an optimizer, or images with only an Exif color space tag instead of an ICC profile.","solutions":["Accept that not all JPEGs embed ICC; this message is expected and non-fatal.","If an ICC profile is required, attach one upstream (embed during encoding) or apply a known profile during display.","Filter the message out of automated logs since it is advisory.","Differentiate from JWRN_BOGUS_ICC, which indicates a malformed profile rather than none at all."],"exampleFix":"// before: expecting ICC from a stripped JPEG\n./djpeg photo.jpg -icc out.icc > out.ppm\n// after: treat absence as normal; check file size\n./djpeg photo.jpg -icc out.icc > out.ppm\n[ -s out.icc ] || echo \"no embedded ICC (expected for sRGB JPEGs)\"","handlingStrategy":"validation","validationCode":"#include <jpeglib.h>\n/* probe before relying on an ICC profile existing */\nint has_icc(j_decompress_ptr c) {\n  JOCTET *p; unsigned int n;\n  int ok = jpeg_read_icc_profile(c, &p, &n);\n  if (ok) free(p);\n  return ok;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the message as advisory; not all JPEGs embed ICC.","Filter it from automated log scanners.","Differentiate JWRN_BOGUS_ICC (malformed) from no-profile."],"tags":["djpeg","icc","advisory","mozjpeg","metadata"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}