Skip to content

Commit

Permalink
LibGfx/JPEG: Don't reject SOF2 image with successive approximations
Browse files Browse the repository at this point in the history
It means full SOF2 JPEG support, yay!
  • Loading branch information
LucasChollet authored and linusg committed Apr 3, 2023
1 parent fbad9a7 commit f42d850
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,7 @@ static ErrorOr<void> read_start_of_scan(Stream& stream, JPEGLoadingContext& cont
current_scan.successive_approximation_high,
current_scan.successive_approximation_low);

// FIXME: Support SOF2 jpegs with current_scan.successive_approximation != 0
if (current_scan.spectral_selection_start > 63 || current_scan.spectral_selection_end > 63 || successive_approximation != 0) {
if (current_scan.spectral_selection_start > 63 || current_scan.spectral_selection_end > 63 || current_scan.successive_approximation_high > 13 || current_scan.successive_approximation_low > 13) {
dbgln_if(JPEG_DEBUG, "ERROR! Start of Selection: {}, End of Selection: {}, Successive Approximation High: {}, Successive Approximation Low: {}!",
current_scan.spectral_selection_start,
current_scan.spectral_selection_end,
Expand Down

0 comments on commit f42d850

Please sign in to comment.