time | Calls | line |
---|
| | 371 | function out = CheckTextItem(in)
|
| | 372 | %CheckTextItem
|
| | 373 | % out = CheckTextItem(in) strips out control characters from text; PNG spec
|
| | 374 | % discourages them. It also replaces [13 10] by 10; then it replaces 13
|
| | 375 | % by 10. The PNG spec says newlines must be represented by a single 10.
|
| | 376 |
|
< 0.001 | 10 | 377 | if (~ischar(in))
|
| | 378 | error(message('MATLAB:imagesci:writepng:invalidTextChunk'));
|
< 0.001 | 10 | 379 | end
|
| | 380 |
|
< 0.001 | 10 | 381 | out = in;
|
< 0.001 | 10 | 382 | out = strrep(out, char([13 10]), char(10));
|
< 0.001 | 10 | 383 | out = strrep(out, char(13), char(10));
|
< 0.001 | 10 | 384 | badChars = find((out < 32) & (out ~= 10));
|
< 0.001 | 10 | 385 | if (~isempty(badChars))
|
| | 386 | warning(message('MATLAB:imagesci:writepng:changedTextChunk'));
|
| | 387 | out(badChars) = [];
|
< 0.001 | 10 | 388 | end
|
Other subfunctions in this file are not included in this listing.