map_clut not possible with .tif

I have aTIF file that I want to apply map_clut as follows
gmic TEST.tif LUT/BandW/BnW\ Film\ Base\ 1.cube 'map_clut[0]' '[1]' 'o[0]' test.jpg
And I get

[gmic]./ Start G'MIC interpreter (v.3.3.2).
[gmic]./ Input all frames of TIFF file 'TEST.tif' at position 0 (2 images [0] = 573x2189x1x3, [1] = 42x160x1x3).
[gmic]./ Input CLUT from file 'LUT/BandW/BnW Film Base 1.cube' (1 image 16x16x16x3).
[gmic]./ Map color LUT [1] on image [0].
[gmic] *** Error in ./ *** Command 'map_clut': Specified CLUT [1] has invalid dimensions (42,160,1,3).

However, when use a .jpg instead of a .tiff, it works. Any ideas what this could be?
TEST.tif (1.0 MB)
BnW Film Base (25.4 KB)

Your TEST.tif file is a multi-page file, containing 2 images.
So when you load it with gmic, image [0] and [1] are already set :

$ gmic TEST.tif


(the second image is a thumbnail of the first one).
So, when you insert your .cube file, it is actually loaded in position [3].

I propose this working command, assuming you don’t want to apply your CLUT to the thumbnail included in the .tif file:

gmic TEST.tif  k[0] LUT/BandW/BnW\ Film\ Base\ 1.cube  map_clut[0] [1] o[0] test.jpg

Should thumbnails be kept when loaded in G’MIC?

Yes, it is not the responsibility of G’MIC to decide for the user. If it decides to avoid certain images, what about multi-page TIFFs? What if it omitted the wrong one? I believe there is also a way to read in a certain image from the container.

Thanks a lot, @David_Tschumperle .