Strange and complicated, my friend...
First, my image examples work here (and should do that in Wales as well), maybe you can add two debug lines to check something...
Code: Select all
Case #ImageHeaderTIF_LSB
a=0
n=*Buffer\l[1]
Debug "Tif "+Str(n); *** ADDED ***
If n>#ImageHeaderSize-#ImageHeaderSizeTif
:
While m And n<#ImageHeaderSizeTif>>1
Debug n; *** ADDED ***
:
You should see
Tif 8 / 5 / 11 / 17 / 559 x 569 | P1170938.tif for my picture and something like
Tif 810008 / 1 / 7 / 600 x 450 | Koala.tif for your examples.
Second, the TGA header seems to allow multiple values, didn't reread the format description but changed the code to allow also $00 (not only $01) now, so I get fine results for these type as well...
559 x 569 | P1170938.jpg
559 x 569 | P1170938.tga
559 x 569 | P1170938.tif
600 x 450 | Chrysanthemum.tga
600 x 450 | Chrysanthemum.tif
960 x 960 | Denzil Washington.jpg
600 x 450 | Desert.tga
600 x 450 | Desert.tif
600 x 450 | Hydrangeas.tga
600 x 450 | Hydrangeas.tif
:
Beside this I start to evaluate the image file type by checking the file extension now, because of the more "looser" header checks (e.g. $00/01 will only be checked for files with the extension TGA). Anyhow you should see correct values for all given images now, I have checked the procedure with ASCII and unicode option set for the compiler.
Code: Select all
Procedure.i CheckImageName(*Name)
Enumeration
#ImageTypeUnknown
#ImageTypeJpg
#ImageTypeJp2
#ImageTypePng
#ImageTypeBmp
#ImageTypeTif
#ImageTypePcx
#ImageTypeGif
#ImageTypeTga
EndEnumeration
Protected n
n=FindString("|jpeg|jpg|jp2|png|bmp|tif|pcx|gif|tga|","|"+LCase(GetExtensionPart(PeekS(*Name)))+"|")
If n>2
n>>2
ElseIf n=2
n=1
EndIf
ProcedureReturn n
EndProcedure