
      program getputim
C
C Program to illustrate use of d8gdims, d8gimg and d8aimg
C
C  Files needed:  old.hdf (look in "files" directory)
C  Files created: new.hdf
C
C****||************************************************************
      integer d8gdims, d8gimg
      integer ispal, ret, width, height

      character*1 image(200,150), pal(768)

C****||********* read in image ******************
      ret = d8gdims('old.hdf', width, height, ispal)
      if ( (width.eq.200) .and. (height.eq.150) ) then
         ret = d8gimg('old.hdf',image,width,height,pal)
         print *,'ret=',ret
      else
         print *, 'width=',width, '    height=',height
         print *, 'Wrong dimensions.  Program aborted.'
         stop
      endif

C****||************ write same image to different file ************
      ret = d8aimg('new.hdf', image, width, height, ispal)

      stop
      end
