Index: trunk/SophyaExt/FitsIOServer/fitsfile.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1418)
+++ trunk/SophyaExt/FitsIOServer/fitsfile.cc	(revision 1499)
@@ -680,20 +680,41 @@
   int ncol;
   long nels=1;
+  int ligneAsolue = NoLine+1;
   for (ncol=0; ncol<nbcols_; ncol++)
     {
+      int repetition =repeat_[ncol]; 
+      int ligneALire = ligneAsolue/repetition;
+      int premierElement  = ligneAsolue-ligneALire*repetition;
+      if (premierElement != 0 )
+	{
+	  ligneALire++;
+	}
+      else premierElement = repetition;
+
       switch (types_[ncol])
 	{ 
 	case FitsDataType_double :
-	  fits_read_col(fptr_,TDOUBLE,ncol+1,NoLine+1,1,1,&dnull,&ddata[dcount++],&anull,&status);
+	  {
+	  fits_read_col(fptr_,TDOUBLE,ncol+1,ligneALire,premierElement,1,&dnull,&ddata[dcount++],&anull,&status);
 	    break;
-	case FitsDataType_float :
-	  fits_read_col(fptr_,TFLOAT,ncol+1,NoLine+1,1,1,&fnull,&fdata[fcount++],&anull,&status);
+	  }
+	case FitsDataType_float :	  
+	  fits_read_col(fptr_,TFLOAT,ncol+1,ligneALire,premierElement,1,&fnull,&fdata[fcount++],&anull,&status);
 	  break;
 	case  FitsDataType_int :
-	  fits_read_col(fptr_,TINT,ncol+1,NoLine+1,1,1,&inull,&idata[icount++],
+	  fits_read_col(fptr_,TINT,ncol+1,ligneALire,premierElement,1,&inull,&idata[icount++],
 			&anull,&status);
 	  break;
+	case  FitsDataType_long :
+	  fits_read_col(fptr_,TLONG,ncol+1,ligneALire,premierElement,1,&inull,&idata[icount++], &anull,&status);
+	case  FitsDataType_byte :
+	  {
+	    unsigned char uschar = 0;
+	    fits_read_col(fptr_,TBYTE,ncol+1,ligneALire,premierElement,1,&inull,&uschar, &anull,&status);
+	    idata[icount++] = (int)uschar;
+	  }
+	  break;
 	case FitsDataType_char :
-	  fits_read_col(fptr_,TSTRING,ncol+1,NoLine+1,1,1,cnull,&cdata[ccount++],&anull,&status);
+	  fits_read_col(fptr_,TSTRING,ncol+1,ligneALire,premierElement,1,cnull,&cdata[ccount++],&anull,&status);
 	  break;
 	}
@@ -1586,4 +1607,6 @@
       cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " to be written= DOUBLE " << endl;
     } 
+  //  cout << " 10 elements de colonne " << endl;
+  //  for (int toto=0; toto < 10; toto++) cout << donnees[toto] << endl;
   fits_write_col(fptr_,TDOUBLE,nocol+1,1,1,nentries, donnees ,&status);
   if( status )  printerror( status,"erreur ecriture du fichier fits" );
Index: trunk/SophyaExt/FitsIOServer/fitsxntuple.cc
===================================================================
--- trunk/SophyaExt/FitsIOServer/fitsxntuple.cc	(revision 1418)
+++ trunk/SophyaExt/FitsIOServer/fitsxntuple.cc	(revision 1499)
@@ -90,4 +90,6 @@
       else if (ss == FitsFile::FitsDataType_float) FfitsCol.push_back(k);
       else if (ss == FitsFile::FitsDataType_int) IfitsCol.push_back(k);
+      else if (ss == FitsFile::FitsDataType_long) IfitsCol.push_back(k);
+      else if (ss == FitsFile::FitsDataType_byte) IfitsCol.push_back(k);
       else if (ss == FitsFile::FitsDataType_char) SfitsCol.push_back(k);
       else {
@@ -122,8 +124,11 @@
       ColName[compt++][LONNOM] =  '\0';
     }
-
+  int ND = DfitsCol.size();
+  int NF = FfitsCol.size();
+  int NI = IfitsCol.size();
+  int NS = SfitsCol.size();
   if(dobj_ == NULL) 
     { 
-      dobj_= new XNTuple(DfitsCol.size(), FfitsCol.size(), IfitsCol.size(), SfitsCol.size(),ColName);
+      dobj_= new XNTuple(ND, NF, NI, NS,ColName);
       ownobj_ = true;      
     }
@@ -132,12 +137,12 @@
       if (ownobj_)
 	{
-	  (*dobj_)= XNTuple(DfitsCol.size(), FfitsCol.size(), IfitsCol.size(), SfitsCol.size(),ColName);
+	  (*dobj_)= XNTuple(ND, NF, NI, NS,ColName);
 	}
       else
 	{
-	  if (DfitsCol.size() != dobj_->NDVar() || FfitsCol.size() != dobj_->NFVar() ||  IfitsCol.size() != dobj_->NIVar() || SfitsCol.size() != dobj_->NSVar())
+	  if (ND != dobj_->NDVar() || NF != dobj_->NFVar() ||  NI != dobj_->NIVar() || NS != dobj_->NSVar())
 	    {
 	      cout << " WARNING : FITS_XNTuple : XNTuple reconfigured " << endl;
-	      (*dobj_)= XNTuple(DfitsCol.size(), FfitsCol.size(), IfitsCol.size(), SfitsCol.size(),ColName);
+	      (*dobj_)= XNTuple(ND, NF, NI, NS,ColName);
 	    }
 	}
@@ -155,16 +160,16 @@
     char** cligne;
 
-  if (DfitsCol.size()>0) dligne = new double[DfitsCol.size()];
+  if (ND>0) dligne = new double[ND];
   else dligne=NULL;
-  if (FfitsCol.size()>0) fligne = new float[FfitsCol.size()];
+  if (NF>0) fligne = new float[NF];
   else fligne=NULL;
-  if (IfitsCol.size()>0) iligne = new int[IfitsCol.size()];
+  if (NI) iligne = new int[NI];
   else iligne=NULL;
-  if (SfitsCol.size()>0) 
-    {
-      cligne = new char*[SfitsCol.size()];
+  if (NS) 
+    {
+      cligne = new char*[NS];
       int  taille_des_chaines=0;
-      for (k=0; k< SfitsCol.size(); k++)  taille_des_chaines = max( taille_des_chaines, is.ColStringLengthFromFits(SfitsCol[k]) );
-      for (k=0; k<SfitsCol.size(); k++) cligne[k]=new char[taille_des_chaines+1];
+      for (k=0; k< NS; k++)  taille_des_chaines = max( taille_des_chaines, is.ColStringLengthFromFits(SfitsCol[k]) );
+      for (k=0; k<NS; k++) cligne[k]=new char[taille_des_chaines+1];
     }
   else cligne=NULL;
@@ -196,4 +201,5 @@
 void FITS_XNTuple::WriteToFits(FitsOutFile& os) 
 {
+
   if(dobj_ == NULL) 
     {
@@ -206,4 +212,5 @@
   // table will have 'nrows' rows
   int nrows = dobj_->NEntry();
+  cout << " FITS_XNTuple::WriteToFits : nombre de lignes a ecrire " << nrows << endl;
   // get names and values from the join DVList object
   DVList dvl= dobj_->Info();
