#NEWLINE# def test_cmyk_interp( tmpdir ) : #NEWLINE# #INDENT# 'A CMYK TIFF has cyan, magenta, yellow, black bands.' #NEWLINE# with rasterio . open ( 'tests/data/RGB.byte.tif' ) as src : #NEWLINE# #INDENT# meta = src . meta #NEWLINE# #UNINDENT# meta [ 'photometric' ] = 'CMYK' #NEWLINE# meta [ 'count' ] = 4 #NEWLINE# tiffname = str ( tmpdir . join ( 'foo.tif' ) ) #NEWLINE# with rasterio . open ( tiffname , 'w' , ** meta ) as dst : #NEWLINE# #INDENT# assert ( dst . profile [ 'photometric' ] == 'cmyk' ) #NEWLINE# assert ( dst . colorinterp ( 1 ) == ColorInterp . cyan ) #NEWLINE# assert ( dst . colorinterp ( 2 ) == ColorInterp . magenta ) #NEWLINE# assert ( dst . colorinterp ( 3 ) == ColorInterp . yellow ) #NEWLINE# assert ( dst . colorinterp ( 4 ) == ColorInterp . black )