From 12ee450f700800de37600494353e39e8be59e928 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Thu, 22 Jul 2004 18:38:45 -0500 Subject: [svn-r8935] Purpose: Bug fix Description: While working on the SZIP documentation with Frank, I realized that when scanline was less than 4k and bigger than pixels_per_block, it was not adjusted if number_of_blocks_per_scanline was bigger than max_number_of_blocks_per_scanline. Solution: Fixed the code. Unfortunately it didn't help with the problem I had using h5repack with DOQGROD.he5 file. Platforms tested: copper Misc. update: --- src/H5Zszip.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index df73932..68fcc29 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -134,7 +134,8 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) scanline=dims[ndims-1]; /* Adjust 'scanline' size if it is smaller than number of pixels per block or - if it is bigger than maximum pixels per scanline */ + if it is bigger than maximum pixels per scanline, or number blocks per scanline + is bigger than maximum value */ /* Check the pixels per block against the 'scanline' size */ if(scanline SZ_MAX_PIXELS_PER_SCANLINE) + if(scanline <= SZ_MAX_PIXELS_PER_SCANLINE) + scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), scanline); + else scanline = cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE; done: -- cgit v0.12