imwrite fails for small images less than 64 rows high

2 visualizzazioni (ultimi 30 giorni)
If I create an unsigned 16 bit array which is greater than 8192 columns wide and try to write it as a tiff image, it seems like it needs to be at least 64 rows high or Matlab 2014a throws an exception. To get around it, the 'RowsPerStrip' tag needs to be set manually to an integer value.
e.g:
x = ones([63 8192], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
BUT:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
gives an exception:
Error using wtifc
TIFF library error - '_TIFFVSetField: 4x8000.tif: Bad value 0 for "RowsPerStrip" tag.'
HOWEVER:
x = ones([64 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
ALSO:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none', 'RowsPerStrip', 16);
works fine.
This was not a problem in 2011b

Risposta accettata

Anand
Anand il 1 Lug 2014
This looks like a bug.
Please contact MathWorks Tech Support by creating a Service Request:

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by