summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5pal.c
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2001-02-16 03:35:37 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2001-02-16 03:35:37 (GMT)
commit5dc419551e3677f6b417ade268da3ee380245b75 (patch)
tree3e5ddb5d15da02e5b04cf0a1017f4d8beaa1f694 /tools/h4toh5pal.c
parenta7c25153bc0b6077613307afd90b6b98c4ebb194 (diff)
downloadhdf5-5dc419551e3677f6b417ade268da3ee380245b75.zip
hdf5-5dc419551e3677f6b417ade268da3ee380245b75.tar.gz
hdf5-5dc419551e3677f6b417ade268da3ee380245b75.tar.bz2
[svn-r3415]
Purpose: bug fix Description: two bugs: 1. different order of conventions of sds and image in hdf4 is considered at h4toh5image.c file. add palette colormodel attribute and correct names of a few attributes. see detail at: http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm 2. convert hdf internal vdata structure(chunking table) into a new hdf5 dataset. Solution: 1. change h5 data space order for image. h5dims[0] = edge[1]-edge[0]; h5dims[1] = start[1]-start[0]; 2. at h4toh5main.c, check the vdata class name and if the first few characters match with HDF_CHK_TBL; ignore converting this vdata. 3. add a few attributes at h4toh5pal.c platforms: linux and sun 5.7(arabica) such as Big-endian-32bit (SUN/IRIX), little-endian-32(LINUX) and 64-bit (IRIX64/UNICOS/DEC-ALPHA) would be good.]
Diffstat (limited to 'tools/h4toh5pal.c')
-rw-r--r--tools/h4toh5pal.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/h4toh5pal.c b/tools/h4toh5pal.c
index 9fc1ec7..556ecdc 100644
--- a/tools/h4toh5pal.c
+++ b/tools/h4toh5pal.c
@@ -56,9 +56,10 @@ int Palette_h4_to_h5(int32 file_id,int32 pal_id,hid_t h5g,char*pal_name) {
size_t h4memsize;
size_t h4size;
- char palette_label[MAX_NC_NAME];
- char palette_class[MAX_NC_NAME];
- char palette_type[MAX_NC_NAME];
+ char palette_label[MAX_PAL_NAME];
+ char palette_class[MAX_PAL_NAME];
+ char palette_type[MAX_PAL_NAME];
+ char palette_colormodel[MAX_PAL_NAME];
hid_t h5memtype;
hid_t h5type;
@@ -143,7 +144,7 @@ int Palette_h4_to_h5(int32 file_id,int32 pal_id,hid_t h5g,char*pal_name) {
strcpy(palette_label,PALABEL);
strcpy(palette_class,PALETTE);
strcpy(palette_type,PAL_TYPE);
-
+ strcpy(palette_colormodel,RGB);
/* convert palette annotation into attribute of palette dataset.
Since there are no routines to find the exact tag of palette object,
we will check three possible object tags of palette objects, that is:
@@ -180,6 +181,12 @@ int Palette_h4_to_h5(int32 file_id,int32 pal_id,hid_t h5g,char*pal_name) {
return FAIL;
}
+ if(h4_transpredattrs(h5dset,PAL_COLORMODEL,palette_colormodel)==FAIL){
+ printf("unable to transfer palette type to HDF4 PALETTE TYPE.\n");
+ H5Sclose(h5d_sid);
+ H5Dclose(h5dset);
+ return FAIL;
+ }
if(h4_transnumattr(h5dset,HDF4_REF_NUM,pal_ref)==FAIL) {
printf("unable to transfer palette reference number to HDF4 REF. NUM.\n");
H5Sclose(h5d_sid);