A JPEG encoder for Javascript