-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge/aous72 20240802 #149
Changes from all commits
a15d3b3
4417d4b
d6297b2
0da149a
c0d46c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ namespace ojph { | |
cur_comp = 0; | ||
cur_line = 0; | ||
cur_tile_row = 0; | ||
resilient = false; | ||
resilient = true; | ||
skipped_res_for_read = skipped_res_for_recon = 0; | ||
|
||
precinct_scratch_needed_bytes = 0; | ||
|
@@ -1046,7 +1046,8 @@ namespace ojph { | |
int marker_idx = find_marker(infile, next_markers, 2); | ||
if (marker_idx == -1) | ||
{ | ||
OJPH_INFO(0x00030067, "File terminated early"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will get back to you on this one -- I need to check the code. |
||
// This is common, so don't log unless needed | ||
// OJPH_INFO(0x00030067, "File terminated early"); | ||
break; | ||
} | ||
else if (marker_idx == 0) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -600,45 +600,45 @@ namespace ojph { | |
void param_siz::read(infile_base *file) | ||
{ | ||
if (file->read(&Lsiz, 2) != 2) | ||
OJPH_ERROR(0x00050041, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050041, "error reading SIZ marker, truncated file"); | ||
Lsiz = swap_byte(Lsiz); | ||
int num_comps = (Lsiz - 38) / 3; | ||
if (Lsiz != 38 + 3 * num_comps) | ||
OJPH_ERROR(0x00050042, "error in SIZ marker length"); | ||
OJPH_ERROR(0x00050042, "error in SIZ marker length %d with components %d", Lsiz, num_comps); | ||
if (file->read(&Rsiz, 2) != 2) | ||
OJPH_ERROR(0x00050043, "error reading SIZ marker"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
OJPH_ERROR(0x00050043, "error reading RSIZ marker"); | ||
Rsiz = swap_byte(Rsiz); | ||
if ((Rsiz & 0x4000) == 0) | ||
OJPH_ERROR(0x00050044, | ||
"Rsiz bit 14 is not set (this is not a JPH file)"); | ||
if ((Rsiz & 0x8000) != 0 && (Rsiz & 0xF5F) != 0) | ||
OJPH_WARN(0x00050001, "Rsiz in SIZ has unimplemented fields"); | ||
if (file->read(&Xsiz, 4) != 4) | ||
OJPH_ERROR(0x00050045, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050045, "error reading XSIZ marker"); | ||
Xsiz = swap_byte(Xsiz); | ||
if (file->read(&Ysiz, 4) != 4) | ||
OJPH_ERROR(0x00050046, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050046, "error reading YSIZ marker"); | ||
Ysiz = swap_byte(Ysiz); | ||
if (file->read(&XOsiz, 4) != 4) | ||
OJPH_ERROR(0x00050047, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050047, "error reading XOSIZ marker"); | ||
XOsiz = swap_byte(XOsiz); | ||
if (file->read(&YOsiz, 4) != 4) | ||
OJPH_ERROR(0x00050048, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050048, "error reading YOSIZ marker"); | ||
YOsiz = swap_byte(YOsiz); | ||
if (file->read(&XTsiz, 4) != 4) | ||
OJPH_ERROR(0x00050049, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050049, "error reading XTSIZ marker"); | ||
XTsiz = swap_byte(XTsiz); | ||
if (file->read(&YTsiz, 4) != 4) | ||
OJPH_ERROR(0x0005004A, "error reading SIZ marker"); | ||
OJPH_ERROR(0x0005004A, "error reading YTSIZ marker"); | ||
YTsiz = swap_byte(YTsiz); | ||
if (file->read(&XTOsiz, 4) != 4) | ||
OJPH_ERROR(0x0005004B, "error reading SIZ marker"); | ||
OJPH_ERROR(0x0005004B, "error reading XTOSIZ marker"); | ||
XTOsiz = swap_byte(XTOsiz); | ||
if (file->read(&YTOsiz, 4) != 4) | ||
OJPH_ERROR(0x0005004C, "error reading SIZ marker"); | ||
OJPH_ERROR(0x0005004C, "error reading YTOSIZ marker"); | ||
YTOsiz = swap_byte(YTOsiz); | ||
if (file->read(&Csiz, 2) != 2) | ||
OJPH_ERROR(0x0005004D, "error reading SIZ marker"); | ||
OJPH_ERROR(0x0005004D, "error reading CSIZ marker"); | ||
Csiz = swap_byte(Csiz); | ||
if (Csiz != num_comps) | ||
OJPH_ERROR(0x0005004E, "Csiz does not match the SIZ marker size"); | ||
|
@@ -652,11 +652,11 @@ namespace ojph { | |
for (int c = 0; c < Csiz; ++c) | ||
{ | ||
if (file->read(&cptr[c].SSiz, 1) != 1) | ||
OJPH_ERROR(0x00050051, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050051, "error reading SSIZ marker"); | ||
if (file->read(&cptr[c].XRsiz, 1) != 1) | ||
OJPH_ERROR(0x00050052, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050052, "error reading XRSIZ marker"); | ||
if (file->read(&cptr[c].YRsiz, 1) != 1) | ||
OJPH_ERROR(0x00050053, "error reading SIZ marker"); | ||
OJPH_ERROR(0x00050053, "error reading YRSIZ marker"); | ||
} | ||
|
||
ws_kern_support_needed = (Rsiz & 0x20) != 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
mkdir -p build | ||
#(cd build && emcmake cmake -DCMAKE_BUILD_TYPE=Debug ..) | ||
(cd build && emcmake cmake ..) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes the default build is debug. |
||
(cd build && emcmake cmake -DCMAKE_BUILD_TYPE=Debug ..) | ||
#(cd build && emcmake cmake ..) | ||
(cd build && emmake make VERBOSE=1 -j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking is that an incomplete file is a catastrophic error.
So the default behavior should be to terminate with an error rather than terminate gracefully.
If the end user accepts this incompleteness, they can use the enable_resilience() function call to enable resilience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we do partial decodes all the time for being able to perform streaming decode, and that is enabled by default now, so we always want to allow it.