From 48e8092c66c7d637d6b6975e4985aa26604f6228 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Thu, 22 Jul 2004 18:40:53 -0500 Subject: [svn-r8936] 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 71abb54..37c5316 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -143,7 +143,8 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) scanline=dims[ndims-1]; /* Adjust scanline 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 there are more than + SZ_MAX_BLOCKS_PER_SCANLINE blocks per scanline */ /* 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