// Internal function to get the header and check it. ILboolean iIsValidJpeg() { ILubyte Head[2]; iGetJpgHead(Head); iseek(-2, IL_SEEK_CUR); // Go ahead and restore to previous state return iCheckJpg(Head); }
// Internal function to get the header and check it. ILboolean iIsValidJpeg(SIO* io) { ILubyte Head[2]; auto read = iGetJpgHead(io, Head); io->seek(io, -read, IL_SEEK_CUR); // Go ahead and restore to previous state if (read == 2) return iCheckJpg(Head); else return IL_FALSE; }