ocrmyimage: complain about ICC profiles being presumed

This commit is contained in:
James R. Barlow
2016-08-02 01:22:36 -07:00
parent bc5d3824bd
commit 0b24f971cd
+8
View File
@@ -417,6 +417,14 @@ def triage_image_file(input_file, output_file, log):
"in its metadata. Estimate the resolution at which "
"image was scanned and specify it using --image-dpi.")
sys.exit(ExitCode.input_file)
if 'iccprofile' not in im.info:
if im.mode == 'RGB':
log.info('Input image has no ICC profile, assuming sRGB')
elif im.mode == 'CMYK':
log.info('Input CMYK image has no ICC profile, not usable')
sys.exit(ExitCode.input_file)
finally:
im.close()