Skip to content

Commit

Permalink
Fix issue with num_components not set
Browse files Browse the repository at this point in the history
Calls to jpeg_simple_progression() should be made after num_components
is set in a function such as jpeg_default_colorspace()
  • Loading branch information
fbossen authored and fbossen committed Mar 5, 2014
1 parent 3287e09 commit 5523494
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jcparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)

#ifdef C_PROGRESSIVE_SUPPORTED
cinfo->optimize_scans = TRUE;
if (cinfo->use_moz_defaults)
jpeg_simple_progression(cinfo);
else {
if (!cinfo->use_moz_defaults) {
/* Default is no multiple-scan output */
cinfo->scan_info = NULL;
cinfo->num_scans = 0;
Expand Down Expand Up @@ -401,6 +399,11 @@ jpeg_set_defaults (j_compress_ptr cinfo)
/* Choose JPEG colorspace based on input space, set defaults accordingly */

jpeg_default_colorspace(cinfo);

#ifdef C_PROGRESSIVE_SUPPORTED
if (cinfo->use_moz_defaults)
jpeg_simple_progression(cinfo);
#endif
}


Expand Down

0 comments on commit 5523494

Please sign in to comment.