struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
unsigned char *scanline;
- unsigned int linesize;
+ unsigned int offset, linesize;
qfile_t* file;
// No DLL = no JPEGs
// Compress each scanline
linesize = cinfo.image_width * 3;
+ offset = linesize * (cinfo.image_height - 1);
while (cinfo.next_scanline < cinfo.image_height)
{
- scanline = &data[cinfo.next_scanline * linesize];
+ scanline = &data[offset - cinfo.next_scanline * linesize];
qjpeg_write_scanlines (&cinfo, &scanline, 1);
if (error_in_jpeg)
{
unsigned char *scanline;
unsigned int linesize;
- int offset;
error_in_jpeg = false;
// Compress each scanline
linesize = width * 3;
- offset = linesize * (cinfo->image_height - 1);
while (cinfo->next_scanline < cinfo->image_height)
{
- scanline = &data[offset - cinfo->next_scanline * linesize];
+ scanline = &data[cinfo->next_scanline * linesize];
qjpeg_write_scanlines (cinfo, &scanline, 1);
if (error_in_jpeg)