Ticket #25413: cfitsio-dist.diff

File cfitsio-dist.diff, 3.4 KB (added by jmroot (Joshua Root), 14 years ago)
  • cfitsio/cfileio.c

    diff -Npru old/cfitsio/cfileio.c new/cfitsio/cfileio.c
    old new int fits_copy_image_section( 
    26472647    char *cptr, keyname[FLEN_KEYWORD], card[FLEN_CARD];
    26482648    int ii, tstatus, anynull;
    26492649    long minrow, maxrow, minslice, maxslice, mincube, maxcube;
    2650     long iii, jjj, kkk, firstpix;
     2650    long firstpix;
     2651    long ncubeiter, nsliceiter, nrowiter, kiter, jiter, iiter;
    26512652    int klen, kk, jj;
    26522653    long outnaxes[9], outsize, buffsize;
    26532654    double *buffer, crpix, cdelt;
    int fits_copy_image_section( 
    28432844
    28442845    minrow = fpixels[1];
    28452846    maxrow = lpixels[1];
     2847    if (minrow > maxrow) {
     2848        nrowiter = (minrow - maxrow + incs[1]) / incs[1];
     2849    } else {
     2850        nrowiter = (maxrow - minrow + incs[1]) / incs[1];
     2851    }
     2852
    28462853    minslice = fpixels[2];
    28472854    maxslice = lpixels[2];
     2855    if (minslice > maxslice) {
     2856        nsliceiter = (minslice - maxslice + incs[2]) / incs[2];
     2857    } else {
     2858        nsliceiter = (maxslice - minslice + incs[2]) / incs[2];
     2859    }
     2860
    28482861    mincube = fpixels[3];
    28492862    maxcube = lpixels[3];
    2850    
     2863    if (mincube > maxcube) {
     2864        ncubeiter = (mincube - maxcube + incs[3]) / incs[3];
     2865    } else {
     2866        ncubeiter = (maxcube - mincube + incs[3]) / incs[3];
     2867    }
     2868
    28512869    firstpix = 1;
    2852     for (kkk = mincube; kkk <= maxcube; kkk += incs[3])
     2870    for (kiter = 0; kiter < ncubeiter; kiter++)
    28532871    {
    2854       fpixels[3] = kkk;
    2855       lpixels[3] = kkk;
    2856       for (jjj = minslice; jjj <= maxslice; jjj += incs[2])
     2872      if (mincube > maxcube) {
     2873         fpixels[3] = mincube - (kiter * incs[3]);
     2874      } else {
     2875         fpixels[3] = mincube + (kiter * incs[3]);
     2876      }
     2877     
     2878      lpixels[3] = fpixels[3];
     2879
     2880      for (jiter = 0; jiter < nsliceiter; jiter++)
    28572881      {
    2858         fpixels[2] = jjj;
    2859         lpixels[2] = jjj;
    2860         for (iii = minrow; iii <= maxrow; iii += incs[1])
     2882        if (minslice > maxslice) {
     2883            fpixels[2] = minslice - (jiter * incs[2]);
     2884        } else {
     2885            fpixels[2] = minslice + (jiter * incs[2]);
     2886        }
     2887
     2888        lpixels[2] = fpixels[2];
     2889
     2890        for (iiter = 0; iiter < nrowiter; iiter++)
    28612891        {
    2862             fpixels[1] = iii;
    2863             lpixels[1] = iii;
     2892            if (minrow > maxrow) {
     2893               fpixels[1] = minrow - (iiter * incs[1]);
     2894            } else {
     2895               fpixels[1] = minrow + (iiter * incs[1]);
     2896            }
     2897
     2898            lpixels[1] = fpixels[1];
    28642899
    28652900            if (bitpix == 8)
    28662901            {
  • cfitsio/changes.txt

    diff -Npru old/cfitsio/changes.txt new/cfitsio/changes.txt
    old new  
    22
    33Version 3.25 - 9 June 2010
    44
     5   - fixed bug that was introduced in version 3.13 that broke the ability
     6     to reverse an image section along the y-axis with an image section
     7     specifier like this: myimage.fits[*,-*].  This bug caused the output
     8     image to be filled with zeros.
     9
    510   - fixed typo in the definition of the ftgprh Fortran wrapper routine
    611     in f77_wrap3.c.
    712
    813   - modified the cfitsio.pc.in configuration file to make the lib path
    9      a variable, instead of hard coding the path.   The provides more
     14     a variable instead of hard coding the path.   The provides more
    1015     flexibility for projects such as suse and fedora when building CFITSIO.
    1116
    1217   - fixed bug in imcomp_compress_tile in imcompress.c which caused