summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h4toh5/h4toh5image.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/h4toh5/h4toh5image.c b/tools/h4toh5/h4toh5image.c
index 94fa08f..a1ab359 100644
--- a/tools/h4toh5/h4toh5image.c
+++ b/tools/h4toh5/h4toh5image.c
@@ -118,7 +118,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
}
istat = GRgetiminfo(ri_id, image_name, &ncomp, &image_dtype,
- NULL, dimsizes, &ngrattrs);
+ &interlace_mode, dimsizes, &ngrattrs);
if(istat == FAIL) {
printf("Cannot obtain GR info. at Image routine.\n");
@@ -154,7 +154,16 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
printf("error in allocating memory for image data. \n");
return FAIL;
}
-
+ /* GRreqimageil or GRreadimage are not working, comment this out for the time being.
+ if(interlace_mode == MFGR_INTERLACE_LINE){
+ istat = GRreqimageil(ri_id,MFGR_INTERLACE_PIXEL);
+ if(istat == FAIL){
+ printf("error in setting interlace_mode.\n");
+ free(image_data);
+ return FAIL;
+ }
+ }
+ */
istat = GRreadimage(ri_id, start, NULL, edges, (VOIDP)image_data);
if (istat == FAIL) {
@@ -179,13 +188,16 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
h5dims24[1] = edges[0]-start[0];
h5dims24[2] = 3;
}
- /* currently scan-line is not supported.
+ /* currently scan-line is not supported. */
else if (interlace_mode == MFGR_INTERLACE_LINE){
- h5dims24[0] = 3;
+ printf("currently line interleaving is not supported.\n");
+ printf("the image %s will not be converted.\n",image_name);
+ free(image_data);
+ return SUCCEED;
+ /*h5dims24[0] = 3;
h5dims24[1] = edges[1]-start[1];
- h5dims24[2] = edges[0]-start[0];
+ h5dims24[2] = edges[0]-start[0];*/
}
- */
else if (interlace_mode == MFGR_INTERLACE_COMPONENT){
h5dims24[0] = 3;
h5dims24[1] = edges[1]-start[1];