Why do I receive a Null Count for Tag reading a TIFF file using IMREAD in MATLAB (R2013a)?

8 views (last 30 days)
I have a TIFF file that causes the following warning when I open it using IMREAD:
Warning: Zero count for ImageDescription tag.
Warning: Zero count for tag.
Warning: TIFF library error - '_TIFFVSetField: T:\1-NC0R95\noread.tiff: Null count for "Tag 50838" (type 4, writecount -3, passcount
1).' - file may be corrupt.
I can open the image in ImageJ without any problem. In fact, I can then re-save the image in ImageJ and open it in MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Jul 2013
It seems that the file is corrupted and is not TIFF-format compliant. When you open and save it using ImageJ (for example), it is likely that this latter formats it correctly and fills in the Tag and ImageDescription fields which seem to be missing in your original file.
A workaround would be to use the MATLAB class function TIFF which is MATLAB's getaway to LibTiff libraries.
Here is simple example:
T = Tiff('myImage.tiff');
I = read(T);
imshow(I);

More Answers (0)

Products


Release

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!