glTexCoord2i doesn't make your texture coordinates scale from 0..Width. They are still ranged from 0..1. Use glTexCoord2f with that proper range and it might solve it. Otherwise the error might be in texture loading.