aboutsummaryrefslogtreecommitdiffstats
path: root/src/jpeg.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2010-01-04 10:09:04 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2010-01-04 10:09:04 -0800
commitbdfc9445506d72d3eec7c3902449efaf13cf0d98 (patch)
tree2c75e72e332c11a3fa290c08355ea850f5612f9c /src/jpeg.c
parentd6bffd293a1443d90c22c24ea162d4ebd6004b00 (diff)
downloadmirror-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jpeg.c b/src/jpeg.c
index d10cede..90ff880 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -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;
}