Skip to content

Commit

Permalink
This fixes tile_size calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Feb 5, 2024
1 parent f90bb33 commit 803782e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/codestream/ojph_params_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ namespace ojph {
void check_validity()
{
if (XTsiz == 0 && YTsiz == 0)
{ XTsiz = Xsiz - XOsiz; YTsiz = Ysiz - YOsiz; }
{ XTsiz = Xsiz + XOsiz; YTsiz = Ysiz + YOsiz; }
if (Xsiz == 0 || Ysiz == 0 || XTsiz == 0 || YTsiz == 0)
OJPH_ERROR(0x00040001,
"You cannot set image extent nor tile size to zero");
Expand Down
4 changes: 2 additions & 2 deletions tests/test_executables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,8 @@ TEST(TestExecutables, SimpleEncIrv97TallNarrow) {
// The compressed file is obtained using these command-line options:
// -o simple_enc_irv97_tall_narrow1.j2c -image_offset {1,0} -qstep 0.1
TEST(TestExecutables, SimpleEncIrv97TallNarrow1) {
double mse[3] = { 96.7935, 69.6824, 66.7822};
int pae[3] = { 41, 39, 35};
double mse[3] = { 100.905762, 76.113037, 72.834717};
int pae[3] = { 39, 35, 34};
run_ojph_compress("tall_narrow.ppm",
"simple_enc_irv97_tall_narrow1", "", "j2c",
"-image_offset \"{1,0}\" -qstep 0.1");
Expand Down

0 comments on commit 803782e

Please sign in to comment.