浏览代码

LibGfx/JPEG: Don't reject SOF2 image with successive approximations

It means full SOF2 JPEG support, yay!
Lucas CHOLLET 2 年之前
父节点
当前提交
f42d850211
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp

+ 1 - 2
Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp

@@ -752,8 +752,7 @@ static ErrorOr<void> read_start_of_scan(Stream& stream, JPEGLoadingContext& cont
         current_scan.successive_approximation_high,
         current_scan.successive_approximation_high,
         current_scan.successive_approximation_low);
         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: {}!",
         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_start,
             current_scan.spectral_selection_end,
             current_scan.spectral_selection_end,