DylanMuir/TIFFStack

Error with uint indexes

Opened this issue · 1 comments

I was getting this error when accessing TIFFStack data using uint32 indexes:

Error using TIFFStack>isvalidsubscript
*** TIFFStack: Subscript indices must either be real positive integers or logicals.

I solved this by changing line 1488 in TIFFStack.m from:
validateattributes(oRefs, {'single', 'double'}, {'integer', 'real', 'positive'});
to:
validateattributes(oRefs, {'numeric'}, {'integer', 'real', 'positive'});

Seems like a logical fix to me, but if I'm not understanding something please let me know.
Let me know if you want me to submit a pull request for this change.

Cheers,
Marcel

Well, it seemed like it was working, but in retrospect it appears that using a uint32 index for the stack frame always returns the first frame, so my above fix is probably not what is wanted. I'm able to work around this by casting my frame index to a double value, which works but is not the expected behavior.