Make the targa encoder return sane error values rather than -1.