diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2010-01-04 10:09:04 -0800 |
---|---|---|
committer | John Hawthorn <john.hawthorn@gmail.com> | 2010-01-04 10:09:04 -0800 |
commit | bdfc9445506d72d3eec7c3902449efaf13cf0d98 (patch) | |
tree | 2c75e72e332c11a3fa290c08355ea850f5612f9c /src/jpeg.c | |
parent | d6bffd293a1443d90c22c24ea162d4ebd6004b00 (diff) | |
download | mirror-meh-bdfc9445506d72d3eec7c3902449efaf13cf0d98.tar.gz mirror-meh-bdfc9445506d72d3eec7c3902449efaf13cf0d98.tar.bz2 mirror-meh-bdfc9445506d72d3eec7c3902449efaf13cf0d98.zip |
major cleanup. xlib methods have been abstracted away as a generic
backend. Represent image states as flags.
Diffstat (limited to 'src/jpeg.c')
-rw-r--r-- | src/jpeg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -70,7 +70,7 @@ void jpeg_prep(struct image *img){ j->cinfo.do_block_smoothing = 0; j->cinfo.quantize_colors = 0; j->cinfo.dct_method = JDCT_FASTEST; - j->cinfo.scale_denom = img->state < FASTLOADED ? 8 : 1; /* TODO: This should be changed done only for large jpegs */ + j->cinfo.scale_denom = (img->state & LOADED) ? 1 : 8; /* TODO: This should be changed done only for large jpegs */ jpeg_calc_output_dimensions(&j->cinfo); @@ -138,7 +138,9 @@ static int jpeg_read(struct image *img){ } jpeg_finish_decompress(&j->cinfo); - img->state = j->cinfo.scale_denom == 1 ? LOADED : FASTLOADED; + img->state |= LOADED; + if(j->cinfo.scale_denom == 1) + img->state |= SLOWLOADED; return 0; } |