Table of Contents


MAGcommentSize - returns size of MAG comment


#include <maglo.h>
long MAGcommentSize(MagImage *mag);


The MAGcommentSize() function returns the length of MAG comment length of MAG file to which mag is associated, in bytes.

MAG comment is terminated with 0x1A, and the returned length does not include the terminating character.

The MAG comment is often stored using Shift-JIS encoding.

Return Values

MAGcommentSize() returns positive comment length.

If the mag is invalid, the behavior is undefined.

See Also

MAGcomment(3) , libmaglo(7)


The MAG specification does not limit the length of comment. This is insecure and difficult to handle (since the library may fall into infinite loop looking for the comment termination), so libmaglo sets artificial limit of file size to 16MB.

Table of Contents