How to identify a corrupted TIFF image

Hi everyone! Here's my first thread...

I have to recognize if a TIFF image is corrupted or not.
I've always used

file -b

to identify file type, but I've experienced that sometimes it returns "TIFF image data, little endian" even if the image is truncated or something.
Do you know another trick to check it?

Thanks!

the file command looks the the magic (first 4 bytes) of the file. Not the whole file.

In order to completely verify a tiff file you have to open it with a drawing/media program that handles these files. TIFF 6.0 is the current version, I think, and it does not specify a checksum, so you cannot calculate one to verify the file independently.

Plus. TIFF uses LZW compression, therefore, opening it to verify the data means using LZW decompresion on the data segment of the file.

So as I understand, there is no way to check TIFF corruption with a bash command...

Nothing native to UNIX will check the file - you need special graphics tools.

If you want a tool - if libtiff is already on your box:

tiffinfo -D myfile.tif

will verify a file

if not you can get libtiff and the toolset here:
LibTIFF - TIFF Library and Utilities

And what about the trick explained here?

That "trick" is meant for files that are corrupted in the file system, eg. missing blocks due to power loss. An incomplete TIFF file is still valid for the file system, as it doesn't care about the content.

Ok, thank you for all your replies!