-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChangeLog
4833 lines (3607 loc) · 216 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Log of Changes Made to CFITSIO
Version 4.5.0 - Aug 2024
- Conversion of CFITSIO configure/build files to better conform with
automake and libtool.
- Bug fix for case of bit column output in string format on clang
compilers with high optimization.
- Added compiler macro support to improve builds on loongarch64 and on
Gnu/Hurd kernels.
- Bug fix to fitsverify utility.
Version 4.4.1 - Jun 2024
- Removed NOSA license and restored previous license file
Version 4.4.0 - Feb 2024
- Reorganization of helper utility code; added fitsverify
- CMakeLists.txt: Changed install location of cfitsio-targets.cmake
to conform with the one listed in cfitsio-config.cmake.in (i.e.
including the extra "cfitsio" subdir of lib/cmake).
- calculator functions that read GTIs do more correct validity
checking of GTI input files
- fits_insert_rows now works if input table starts with both no rows
and no columns
- Can now write internal memory files of size > 2^32 directly to a
gzip-compressed output file.
- Added support for unsigned long long types to fits_update_key.
- Added ability for Windows builds to handle UTF-8 needed for reading
filenames with non-ASCII characters.
- Added 2-byte int test to speed.c utility.
- Made fix to http file handler to expand the allowed URL length.
Version 4.3.1 - Nov 2023 (patch release)
- Patch fix needed for modify and delete keyword functions to fully
conform with v4.3.0 long string keyword read/write enhancements.
Version 4.3.0 - Jul 2023
- Bug fix to fits_make_hist[d] that was introduced in 4.2.0.
- Added overflow checking for case of reading images with 8-byte
float values into 4-byte float arrays.
- fits_write_key_longstr now handles case of writing a long keyword
in combination with a long keyword value string.
- Add conversion of French locale comma-to-period in corner cases
appearing in ffr2e and ffd2e functions.
- Increased the precision when writing version number to User-Agent
strings for http connections. This is needed to fully conform to
3-field version string format.
- Bug fix to GTIOVERLAP() calculator function, which was being
treated as a boolean value in expressions, and is now correctly
treated as a floating point result.
- Bug fix to ARRAY() calculator function, which caused a memory
overflow error
- Enhancement to the ARRAY function, such that ARRAY(V,d) can
apply new dimensions to V, as long as the total number
of array/vector elements does not change.
- Enhancement of long string keyword read/write functions to fully
conform with FITS standard specifications for multi-line value
and comment strings. Two new functions have been added to
implement this: fits_get_key_com_strlen and fits_read_string_key_com.
Version 4.2.0 - Nov 2022
- This release includes patches to security vulnerabilities. We
strongly encourage this upgrade, particularly for those running
CFITSIO in web accessible applications.
- Fix to fits_read_key function, which was failing to properly read
keywords declared type TUINT on compilers where sizeof(int) =
sizeof(long).
- Added new functions fits_read_cols and fits_write_cols to efficiently
read or write multiple columns in a single function call
- Added new function fits_copy_selrows to copy only selected rows, such
as the selected rows returned by fits_find_rows
- Added new calculator functions ERF(X), ERFC(X) and GAMMA(X), which are
mathematical special functions of the same name
- Added new calculator function GTIFIND() which reports which GTI row
brackets a given time sample
- Added new calculator functions which operate upon vector table
values NAXIS(V), NAXES(V,n), ELEMENTNUM(V) and AXISELEM(V,n),
and ARRAY(X,d) which promotes scalar X to a vector or array
with given dimensions.
- The CFITSIO histogramming code now handles binning by any
arbitrary calculator expression rather than just a column name.
Both the binned columns as well as the optional weights may be
calculator expressions, enclosed in parentheses.
- Binning of vector columns or expressions is now supported, as long
as all binned inputs (as well as the optional weighting) have the
same vector dimensions. Binning of variable-length columns remains
unsupported.
- A bug that caused histogram weights from columns that are null values
to be tallied along with non-null values has been fixed.
- The CFITSIO calculator and histogramming functionality is now
fully reentrant and does not require multithreading interlocks.
- A long-standing segmentation fault bug in the histogramming code
related to binning any value using the "reciprocal" /XXXX notation
has been fixed.
- Added mutex locks for thread safety in ftgiou and ftfiou.
- Added several Fortran wrappers to support image read/write when
'fpixel' and 'nelements' are 8-byte integers.
- Fixed bug which was adding spaces to some cases of long string key
value output.
Version 4.1.0 - Feb 2022
- Calls to the zlib inflate() function in zcompress.c now handle
the Z_BUF_ERROR return value rather than exiting.
- The SUBTRACTIVE_DITHER_2 option has been removed when using the
HCOMPRESS algorithm.
- Updated fits_get_version function to return a float calculated
from 3 version fields.
- Added handling of SBYTE_IMG and ULONGLONG_IMG types to the
fits_resize_img function.
- Updates made to C/Fortran interfacing in cfortran.h and f77_wrap.h
specifically driven by new Mac/ARM architecture.
- Fix to the fits_insert_col functions to handle columns with
TULONGLONG data.
Version 4.0.0 - May 2021
- Removed separate directory for zlib/gzip code, and updated
configuration to check for zlib on the user's system (required).
When use of cURL is enabled, it may also pull in zlib such
that user applications may not need to link with it separately.
- Changed version numbering to 3-field format.
- Added new calculator functions SETNULL(x,y) to allow substitution of
NULL values into tables, and GTIOVERLAP() for calculating the amount
of GTI overlap exposure for a time bin.
- Fix added for proper handling of string columns with zero repeat
count.
- Fix to column filtering expressions which write #NULL values to
columns of type (J) format.
- Fix to memory clearing when using polygon shapes in region files.
- Fix to fits_str2time function so that it now flags a particular case
of bad syntax which was previously getting through.
- In ffgclb and ffpclb (read/write byte columns), the "undocumented"
feature of being able to transfer columns 'A' string columnss as
byte arrays is now handled correctly, with improved error checking
via updates to ffgcprll. More documentation on string handling is
in cfitsio.tex.
- Fix bug in 'colfilter' functionality. When performing a
column deletion of the form -COLNAM*, and multiple matches
existed, then none of the matches got deleted. Now the
first is deleted as expected.
- Improved handling of corner case in ffpkn functions.
- In ffgky, modified TULONG case to allow it to read unsigned
values greater than the 8-byte signed limit.
- Fix to parsing of corner case of extended file syntax.
- Major updates to CMake configuration.
Version 3.49 - Aug 2020
- Fix to imcompress.c. It now turns off quantization if ZSCALE
and ZZERO columns are missing. Treatment will be the same as
if ZQUANTIZ were set to 'NONE', even if ZQUANTIZ is present
and set to something else.
- Added mutex to fits_execute_template() function so that the
creation of files using ASCII templates will be thread safe.
- In fpack when using -table flag, replaced warning message with a
more detailed description mentioning FITS format update.
- Added flag to CMake builds to disable curl dependency. Also
only add CURL_LIBRARIES to CMake link target if curl is found.
- Minor adjustment to download progress output.
Version 3.48 - Mar 2020
- Now can handle parentheses in path names rather than automatically
interpreting them as output file specifiers.
- Fixed bug in imcompress.c that wasn't properly handling conversion
between float and double types when reading from a gzip compressed
float or double image.
- Fixed bug that was preventing use of bracket and parentheses symbols
in pathnames when opening multiple READWRITE files, even when
requesting no-extended-syntax usage. *This fix necessitates a
library interface version number change.
- Fixed bug in ffmnhd / fits_movnam_hdu to properly handle wildcard
syntax.
- Fixed bug in fits_open_extlist to handle filename[EXT] syntax
properly. The hdutype parameter may now be null. More documentaion
for this function is in cfitsio.tex.
- Added new function fits_copy_hdutab to create a new table with the same
structure as an existing table.
- fits_copy_col / ffcpcl handles long long integer data types more
natively to prevent precision loss.
- histo.c routines now recognize integer columns that have been scaled by
TSCALn keywords and may be closer to floating point type.
- Added backward compatibility for very old Rice compressed files which
were not using the ZVAL2 keyword in the way that later became standard.
- Change made to cfitsio.pc.in to prevent forcing downstream libraries
to link against cfitsio's dependencies when using pkgconfig.
Version 3.47 - May 2019
- Added set of drivers for performing ftps file transfers.
- Tile sizes for compression may now be specified for any pair of
axes, where previously 2D tiles where limited to just X and y.
- Fix to ffgsky and ffgkls functions for case of keyword with long
string values where the final CONTINUE statement ended with '&'.
If the final CONTINUE also contained a comment, it was being
repeated twice when passed back through the 'comm' argument.
- Fix made to ffedit_columns() for case of multiple col filters
containing wildcards. Only the first filter was being searched.
- fits_copy_rows (ffcprw) can now handle 'P'-type variable-length
columns.
- Fix made to an obscure case in fits_modify_vector_len, where a
wrongly issued EOF error may occur.
- Added internal fffvcl() function.
Version 3.46 - Oct 2018 (Ftools release)
- Improved the algorithm for ensuring no tile dimensions are smaller
than 4 pixels for HCOMPRESS compression.
- Added new functions intended to assist in diagnosing (primarily
https) download issues: fits_show_download_progress,
fits_get_timeout, fits_set_timeout.
- Added the '-O <file>' option to fpack, which previously existed only
for funpack. Also added fpack/funpack auto-removal of .bz2 suffix
equivalent to what existed for .gz.
- For the fpack '-table' cases, warning message is now sent to stderr
instead of stdout. This is to allow users to pipe the results from
stdout in valid FITS format. (The warning message is otherwise placed
at the start of the FITS file and therefore corrupts it.)
- Fix made to the '-P' file prefix option in funpack.
- Added wildcard deletion syntax for columns, i.e. -COLNAM* will delete
the first matching column as always; -COLNAM*+ will delete all matching
columns (or none); exact symmetry with the keyword deletion syntax.
Version 3.45 - May 2018
- New support for reading and writing unsigned long long datatypes.
This includes 'implicit datatype conversion' between the unsigned long
long datatype and all the other datatypes.
- Increased the hardcoded NMAXFILES setting for maximum number of
open files from 1000 to 10000.
- Bug fix to fits_calc_binning wrapper function, which wasn't filling
in the returned float variables.
- Fixed a parsing bug for image subsection and column binning range
specifiers that was introduced in v3.44.
Version 3.44 - April 2018
- This release primarily patches security vulnerabilities. We
strongly encourage this upgrade, particularly for those running
CFITSIO in web accessible applications.
In addition, the following enhancements and fixes were made:
- Enhancement to 'template' and 'colfilter' functionality. It is now
possible to delete multiple keywords using wildcard syntax. See
"Column and Keyword Filtering Specification" section of manual for
details.
- histo.c uses double precision internally for all floating point
binning; new double-precision subroutines fits_calc_binningd(),
fits_rebin_wcsd(), and fits_make_histd(); existing
single-precision histogram functions still work but convert values
to double-precision internally.
- new subroutine fits_copy_cols() / ffccls() to copy multiple columns
- Fix in imcompress.c for HCOMPRESS and PLIO compression of unsigned
short integers.
- Fix to fits_insert_card(ffikey). It had wrongly been capitalizing
letters that appeared before an '=' sign on a CONTINUE line.
Version 3.43 - March 2018
The NASA security team requires the following warning to all users of
CFITSIO:
=====
The CFITSIO open source software project contains vulnerabilities
that could allow a remote, unauthenticated attacker to take control
of a server running the CFITSIO software. These vulnerabilities
affect all servers and products running the CFITSIO software.
The CFITSIO team has released software updates to address these
vulnerabilities. There are no workarounds to address these
vulnerabilities. In all cases, the CFITSIO team is recommending an
immediate update to resolve the issues.
=====
- Fixed security vulnerabilities.
- Calls to https driver functions in cfileio.c need to be macro-
protected by the HAVE_NET_SERVICES variable (as are the http and
ftp driver function calls). Otherwise CMake builds on native
Windows will fail since drvrnet.o is left empty.
- Bug fix to ffmvec function. Should be resetting a local colptr
variable after making a call to ffiblk (which can reallocate Ftpr->
tableptr). Originally reported by Willem van Straten.
- Ignore any attempted request to not quantize an image before
compressing it if the image has integer datatype pixels.
- Improved error message construction throughout CFITSIO.
Version 3.42 - August 2017 (Stand-alone release)
- added https support to the collection of drivers handled in cfileio.c
and drvrnet.c. This also handles the case where http transfers are
rerouted to https. Note that this enhancement introduces a dependency
on the libcurl development package. If this package is absent, CFITSIO
will still build but will not have https capability.
- made fix to imcomp_init_table function in imcompress.c. It now writes
ZSIMPLE keyword only to a compressed image that will be placed in the
primary header.
- fix made to fits_get_col_display_width for case of a vector column
of strings.
Version 3.42 - March 2017 (Ftools release only)
- in ftp_open_network and in ftp_file_exist, added code to repeatedly
attempt to make a ftp connection if the ftp server does not respond
to the first request. (some ftp servers don't appear to be 100% reliable).
- in drvrnet.c added many calls to 'fclose' to close unneeded files,
to avoid exceeding the maximum allowed number of files that can be
open at once.
- made substantial changes to the ftp_checkfile and http_checkfile routines
to streamline the process of checking for the existence of a .gz or .Z
compressed version of the file before opening the uncompressed file
(when using http or ftp to open the file).
- modified the code in ftp_open_network to send "\r\n" as end-of-line
characters instead of just "\n". Some ftp servers (in particular,
at heasarc.gsfc.nasa.gov) now require both characters, otherwise the
network connection simply hangs.
- modified the http_open_network routine to handle HTTP 301 or 302 redirects
to a FTP url. This is needed to support the new configuration on
the heasarc HTTP server which sometimes redirects http URLS to a ftp URL.
Version 3.41 - November 2016
- The change made in version 3.40 to include strings.h caused problems on
Windows (and other) platforms, so this change was backed out. The reason
for including it was to define the strcasecmp and strcasencmp functions, so
as an alternative, new equivalent functions called fits_strcasecmp and
fits_strncasecmp have been added to CFITSIO.as a substitute. All the
previous calls to the str[n]casecmp functions have been changed to
now call fits_str[n]casecmp. In addition, the previously defined
ngp_strcasecmp function (in grparser.c) has been removed and the calls to
it have been changed to fits_strcasecmp.
- The speed.c utility program was changed to correctly call
the gettimeofday function with a NULL second arguement.
Version 3.40 - October 2016
- fixed a bug when writing long string keywords with the CONTINUE convention
which caused the CONTINUE'd strings to only be 16 characters long, instead
of using up all the available space in the 80-character header record.
- fixed a missing 'defined' keyword in fitsio.h.
- replaced all calls to strtok (which is not threadsafe) with a new ffstrtok
function which internally calls the threadsafe strtok_r function. One
byproduct of this change is that <strings.h> must also be included
in several of the C source code files.
- modified the ffphbn function in putkey.c to support TFORM specifiers that
use lowercase 'p' (instead of uppercase) when referring to a variable-length
array column.
- modified the lexical parser in eval.y and eval_y.c to support bit array
columns (with TFORMn = 'X') with greater than 256 elements. Fix to bitcmp
function: The internal 'stream' array is now
allocated dynamically rather than statically fixed at size 256.
This was failing when users attempted a row filtering of a bitcol
that was wider than 256X. In bitlgte, bitand, and bitor functions, replaced
static stream[256] array allocation with dynamic allocation.
- modified the ffiter function in putcol.c to fix a problem which could
cause the iterator function to incorrectly deal with null values. This
only affected TLONG type columns in cases where sizeof(long) = 8, as well
as for TLONGLONG type columns.
- Fix made to uncompress2mem function in zcomprss.c for case where output
uncompressed file expands to over the 2^32 (4Gb) limit. It now
checks for this case at the start, and implements a 4Gb paging
system through the output buffer. The problem was specifically
caused by the d_stream.avail_out member being of 4-byte type uInt,
and thus unable to handle any memory position values above 4Gb.
- fixed a bug in fpackutil.c when using the -i2f (integer to float) option
in fpack to compress an integer image that is scaled with non-default values
for BSCALE and BZERO. This required an additional call to ffrhdu to reset
the internal structures that describe the input FITS file.
- modified fits_uncompress_table in imcompress.c to silently ignore the
ZTILELEN keyword value if it larger than the number of rows in the table
- Tweak strcasecmp/strncasecmp ifdefs to exclude 64-bit MINGW
environment, as it does not lack those functions. (eval_l.c,
fitsio2.h)
- CMakeLists.txt: Set M_LIB to "" for MINGW build environment (in
addition to MSVC).
- Makefile.in: Add *.dSYM (non-XCode gcc leftovers on Macs) to
clean list. Install libs by name rather than using a wildcard.
- configure: Fix rpath token usage for XCode vs. non-XCode gcc on Macs.
Version 3.39 - April 2016
- added 2 new routines suggested by Eric Mandel:
ffhisto3 is similar to ffhisto2, except that it does not close the
original file.
fits_open_extlist is similar to fits_open_data except that it opens
the FITS file and then moves to the first extension in the user-input
list of 'interesting' extensions.
- in ffpsvc and ffprec, it is necessary to treat CONTINUE, COMMENT, HISTORY,
and blank name keywords as a special case which must be treated differently
from other keywords because they have no value field and, by definition,
have keyword names that are strictly limited in length.
- added the Fortran wrapper routines for the 2 new string keyword reading
routines (FTGSKY and FTGKSL), and documented all the routines in the
FITSIO and CFITSIO users guides.
- in ffinttyp, added explicit initialization of the input 'negative'
argument to 0.
- added new routine to return the length of the keyword value string:
fits_get_key_strlen / ffgksl.
This is primarily intended for use with string keywords
that use the CONTINUE convention to continue the
value over multiple header records, but this routine can be used
to get the length of the value string for any type keyword.
- added new routine to read string-valued keywords:
fits_read_string_key / ffgsky
This routine supports normal string keywords as well as long string
keywords that use the CONTINUE convention. In many cases this routine
may be more convenient to use then the older fits_read_key_longstr
routine.
- changed the prototype of fits_register_driver in fitsio2.h so that the
pointer definition argument does not have the same name as the pointer
itself (to work around a bug in the pgcc compiler).
- added the missing FTDTDM fortran wrapper definition to f77_wrap3.c.
- modified Makefile.in and configure.in to add LDFLAGS_BIN for task linker
flages, which will be the same as LDFLAGS except on newer Mac OS X where
an rpath flag is added.
- modified Makefile.in to add a new "make utils" command which will build
fpack, funpack, cookbook, fitscopy, imcopy, smem, speed, and testprog.
These programs will be installed into $prfix/bin.
- fixed a bug when attempting to modify the values in a variable-length
bit ("X") column in a binary table.
- reinstated the ability to write HIERARCH keywords that contain characters
that would not be allowed in a normal 8-character keyword name, which had
been disabled in the previous release.
Version 3.38 - February 2016
- CRITICAL BUG FIX:
The Intel 15 and 16 compilers (and potentially other compilers) may silently
produce incorrect assembly code when compiling CFITSIO with the -O2 (or
higher) optimization flag. In particular, this problem could cause CFITSIO
to incorrectly read the values of arrays of 32-bit integers in a FITS file
(i.e., images with BITPIX = 32 or table columns with TFORM = 'J') when the
array is being read into a 'long' integer array in cases where the long
array elements are 8 bytes long.
One way to test if a particular system is affected by this problem is to
compile CFITSIO V3.37 (or earlier) with optimization enabled, and then
compare the output of the testprog.c program with the testprog.out file
that is distributed with CFITSIO. If there are any differences in the
files, then this system might be affected by this bug. Further tests
should be performed to determine the exact cause.
The root cause of this problem was traced to the fact that CFITSIO was
aliasing an array of 32-bit integers and an array of 64-bit integers to the
same memory location in order to obtain better data I/O efficiency when
reading FITS files. When CFITSIO modified the values in these arrays, it
was essential that the processing be done in strict sequential order from
one end of the array to the other end, as was implicit in the C code
algorithm. In this case, however, the compiler adopted certain loop
optimization techniques that produced assembly code that violated this
assumption. Technically, the CFITSIO code violates the "strict aliasing"
assumption in ANSI C99, therefore the affected CFITSIO routines have been
modified so that the aliasing of different data types to the same memory
location no longer occurs.
- fixed problem in configure and configure.in which caused the programs that
are distributed with CFITSIO (most notably, fack and funpack) to be build
without using any compiler optimization options, which could make them
run more slowly than expected.
- in imcompress.c, fixed bug where the rowspertile variable (declared as 'long')
was mistakenly declared as a TLONGLONG variable in a call to fits_write_key.
This could have caused the ZTILELEN keyword to be written incorrectly in
the header of tile-compressed FITS tables on systems where sizeof(long) = 4.
- in imcompress.c, implemented a new set of routines that safely convert
shorter integer arrays into a longer integer arrays (e.g. short to int)
where both arrays are aliased to the same memory location. These
special routines were needed to guard against certain compiler optimization
techniques that could produce incorrect code.
- modified the 4 FnNoise5_(type) routines in quantize.c to correctly
count the number of non-null pixels in the input array. Previously the
count could be inaccurate if the image mainly consisted of null pixels.
This could have caused certain floating point image tiles to be
quantized during the image compression process, when in fact the tile
did not satisfy all the criteria to be safely quantized.
- in imcomp_copy_comp2img, added THEAP to the list of binary table
keywords that may be present in the header of a compressed image
and should not be copied to the uncompressed image header.
- modified fits_copy_col to check that when copying a vector column, the
vector length in the output column is the same as in the input column.
Also modified the code to support the case where a column is being copied
to an earlier position in the same table (which shifts the input column
over 1 space).
- added configure option (--with-bzip2) to support reading bzip2 compressed
FITS files. This also required modifications to drvrmem.c and drvrfile.c
This depends on having the bzlib library installed on the
local machine. This patch was submitted by Dustin Lang.
- replaced calls to 'memcpy' by 'memmove' in getcolb.c, getcold.c,
getcole.c, and getcoli.c to support cases where the 2 memory areas
overlap. (submitted by Aurelien Jarno)
- modified the FITS keyword reading and writing routines to potentially
support keywords with names longer than 8-characters. This was implemented
in anticipation of a new experimental FITS convention which allows longer
keyword names.
- in fits_quantize_double in quantize.c, test if iseed == N_RANDOM,
to avoid the (unlikely) possibility of overflowing the random number
array bounds. (The corresponding fits_quantize_float routine already
performed this test).
- in the FnNoise5_short routine in quantize.c, change the first 'if'
statement from "if (nx < 5)" to "if )nx < 9)", in order to support the
(very rare) case where the tile is from 5 to 8 pixels wide. Also make
the same change in the 3 other similar FnNoise5_* routines.
- in the qtree_bitins64 routine in fits_hdecompress.c, must declare the
plane_val variable as 'LONGLONG' instead of int. This bug could have
caused integer overflow errors when uncompressing integer*4 images that
had been compressed with the Hcompress algorithm, but only in cases
where the image contains large regions of pixels whose values are close
to the maximum integer*4 value of 2**31.
- in fits_hcompress.c, call the calloc function instead of malloc when
allocating the signbits array, to eliminate the need to individually
set each byte to zero.
- in the ffinit routine, and in a couple other routines that call ffinit,
initialize the *fptr input parameter to NULL, even if the input
status parameter value is greater than zero. This helps prevent
errors later on if that fptr value is passed to ffclos.
- modified ftcopy, in edithdu.c, to only abort if status > 0 rather
than if status != 0. This had caused a problem in funpack in rare
circumstances.
- in imcompress.c changed all the calls to ffgdes to ffgdesll, to support
compressed files greater than 2.1 GB in size.
- fixed bug in ffeqtyll when it is called with 4th and 5th arguments
set to NULL.
- in fitsio.h, added the standard C++ guard around the declaration of the
function fits_read_wcstab. (reported by Tammo Jan Dijkema, Astron.)
- in fitsio.h, changed the prototype variable name "zero" to "zeroval" to
avoid conflict in code that uses a literal definition of 'zero' to mean 0.
- tweaked Makefile.in and configure.in to use LDFLAGS instead of CFLAGS
for linking, use Macros for library name, and let fpack and funpack
link with shared library.
- modified an 'ifdef' statement in cfileio.c to test for '__GLIBC__'
instead of 'linux' when initializing support for multi-threading.
- modified ffeqtyll to return an effective column data type of TDOUBLE
in the case of a 'K' (64-bit integer) column that has non-integer
TSCALn or TZEROn keywords.
- modified ffgcls (which returns the value in a column as a formatted string)
so that when reading a 'K' (TLONGLONG) column it returns a long long integer
value if the column is not scaled, but returns a double floating point
value if the column has non-integer TSCALn or TZEROn values.
- modified fitsio.h to correctly define "OFF_T long long" when using
the Borland compiler
- converted the 'end of line' characters in simplerng.c file to the unix
style, instead of PC DOS.
- updated CMakeLists.txt CMake build file which is primarily used to
build CFITSIO on Windows machines.
- modified fits_get_keyclass to recognize ZQUANTIZ and ZDITHER0 as
TYP_CMPRS_KEY type keywords, i.e., keywords used in tile compressed
image files.
- added test to see if HAVE_UNISTD_H is defined, as a condition for
including unistd.h in drvrfile.c drvrnet.c, drvrsmem.c, and group.c.
- modified the CMakelist.txt file to fix several issues (primarily for
building CFITSIO on Windows machines)..
- fixed bug when reading tile-compressed images that were compressed with
the IRAF PLIO algorithm. This bug did not affect fpack or funpack, but
other software that reads the compressed image could be affected. The
bug would cause the data values to be offset by 32768 from the actual
pixel values.
Version 3.37 - 3 June 2014
- replaced the random Gaussian and Poissonian distribution functions with
new code written by Craig Markwardt derived from public domain C++ functions
written by John D Cook.
- patched fitsio2.h to support CFITSIO on AArch64 (64-bit ARM)
architecture (both big and little endian). Supplied by
Marcin Juszkiewicz and Sergio Pascual Ramirez, with further update
by Michel Normand.
- fixed bug in fpackutil.c that caused fpack to exit prematurely if
the FZALGOR directive keyword was present in the HDU header.
Version 3.36 - 6 December 2013
- added 9 Dec: small change to the fileseek function in drvrfile.c to
support large files > 2 GB when building CFITSIO with MinGW on Windows
- reorganized the CFITSIO code directory structure; added a 'docs'
subdirectory for all the documentation, and a 'zlib' directory
for the zlib/gzip file compression code.
- made major changes to the compression code for FITS binary table
to support all types of columns, including variable-length arrays.
This code is mainly used via the fpack and funpack programs.
- increased the number of FITS files that can be opened as one
time to 1000, as defined by NMAXFILES in fitsio2.h.
- made small configuration changes to configure.in, configure,
fitsio.h, and drvrfile.c to support large files (64-bit file
offsets} when using the mingw-w64 compiler (provided by
Benjamin Gilbert).
- made small change to fits_delete_file to more completely ignore
any non-zero input status value.
- fixed a logic error in a 'if' test when parsing a keyword name
in the ngp_keyword_is_write function in grparser.c (provided
by David Binderman).
- when specifying the image compression parameters as part of the
compressed image file name (using the "[compress]" qualifier
after the name of the file), the quantization level value, if
specified, was not being recognized by the CFITSIO compression
routines. The image would always be compressed with the default
quantization level of 4.0, regardless of what was specified. This
affected the imcopy program, and potentially other user-generated
application programs that used this method to specify the
compression parameters. This bug did not affect fpack or
funpack. This was fixed in the imcomp_get_compressed_image_par
routine in the imcompress.c file. (reported by Sean Peters)
- defined a new CFITS_API macro in fitsio.h which is used to export the
public symbols when building CFITSIO on Windows systems with CMake. This
works in conjunction with the new Windows CMake build procedure that
is described in the README.win32 file. This complete revamping of the
way CFITSIO is built under Windows now supports building 64-bit
versions of the library. Thanks to Daniel Kaneider (Luminance HDR
Team) for providing these new CMake build procedures.
- modified the way that the low-level file_create routine works when
running in the Hera environment to ensure that the FITS file that is
created is within the allow user data disk area.
- modified fits_get_compression_type so that it does not return an error
if the HDU is a normal FITS IMAGE extension, and is not a tile-compressed
image.
- modified the low-level ffgcl* and ffpcl* routines to ensure that they
never try ro read or write more than 2**31 bytes from disk at one time,
as might happen with very large images, to avoid integer overflow errors.
Fix kindly provided by Fred Gutsche at NanoFocus AG (www.nanofocus.de).
- modified Makefile.in so that doing 'make distclean' does not delete
new config.sub and config.guess files that were recently added.
- adopted a patch from Debian in zcompress.c to "define" the values of
GZBUFSIZE and BUFFINCR, instead of exporting the symbols as 'int's.
Version 3.35 - 26 June 2013 (1st beta release was on 24 May)
- fixed problem with the default tile size when compressing images with
fpack using the Hcompress algorithm.
- fixed returned value ("status" instead of "*status")
- in imcompress.c, declared some arrays that are used to store the dimensions
of the image from 'int' to 'long', to support very large images (at least
on systems where sizeof(long) = 8),
- modified the routines that convert a string value to a float or double
to prevent them from returning a NaN or Inf value if the
string is "NaN" or "Inf" (as can happen with gcc implementation of the
strtod function).
- removed/replaced the use of the assert() functions when locking or
unlocking threads because they did not work correctly if NDEBUG is
defined.
- made modifications to the way the command-line file filters are parsed to
1) remove the 1024-character limit when specifying a column filter,
2) fixed a potential character buffer-overflow risk in fits_get_token, and
3) improved the parsing logic to remove any possible of confusing
2 slash characters ("//") in the string as the beginning of a
comment string.
- modified configure and Makefile.in so that when building CFITSIO
as a shared library on linux or Mac platforms, it will use the SONAME
convention to indicate whether each new release of the CFITSIO
library is binary-compatible with the previous version. Application
programs that link with the shared library will not need to be
recompiled as long as the versions are compatible. In practice,
this means that the shared library binary file that is created (on
Linux systems) will have a name like 'libcfitsio.so.I.J.K', where I is the
SONAME version number, J is the major CFITSIO version number (e.g. 3),
and K is the minor CFITSIO version number (e.g., 34). Two link
files will also be created such that
libcfitsio.so -> libcfitsio.so.I, and
libcfitsio.so.I -> libcfitsio.I.J.K
Application programs will still run correctly with the new version of
CFITSIO as long as the 'I' version number remains the same, but the
applications will fail to run if the 'I' number changes, thus alerting
the user that the application must be rebuilt.
- fixed bug in fits_insert_col when computing the new table row width
when inserting a '1Q' variable length array column.
- modified the image compression routines so that the output compressed
image (stored in a FITS binary table) uses the '1Q' variable length
array format (instead of '1P') when the input file is larger than 4 GB.
- added support for "compression directive" keywords which indicate how
that HDU should be compressed (e.g., which compression algorithm to use,
what tiling pattern to use, etc.). The values of these keywords will
override the compression parameters that were specified on the command
line when running the fpack FITS file compression program.
- globally changed the variable and/or subroutine name "dither_offset"
to "dither_seed" and "quantize_dither" to "quantize_method" so
that the names more accurately reflects their purpose.
- added support for a new SUBTRACTIVE_DITHER_2 method when compressing
floating point images. The only difference with the previous method
is that pixels with a value exactly equal to 0.0 will not be dithered,
and instead will be exactly preserved when the image is compressed.
- added support for an alias of "RICE_ONE" for "RICE_1" as the value
of the ZCMPTYPE keyword, which gives the name of the image compression
algorithm. This alias is used if the new SUBTRACTIVE_DITHER_2 option
is used, to prevent old versions of funpack from creating a corrupted
uncompressed image file. Only newer versions of funpack will recognize
this alias and be able to uncompress the image.
- made performance improvement to fits_read_compressed_img so that
when reading a section of an compressed image that includes only
every nth pixel in some dimension, it will only uncompressed a tile
if there are actually any pixels of interest in that tile.
- fixed several issues with the beta FITS binary table compression code
that is used by fpack: added support for zero-length vector columns,
made improvements to the output report when using the -T option in fpack,
changed the default table compression method to 'Rice' instead of
'Best', and now writes the 'ZTILELEN' keyword to document the number
of table rows in each tile.
- fixed error in ffbinit in calculating the total length of the binary
table extension if the THEAP keyword was used to override the
default starting location of the heap.
Version 3.34 - 20 March 2013
- modified configure and configure.in to support cross-compiled cfitsio
as a static library for Windows on a Linux platform using MXE
(http://mxe.cc) - a build environment for mingw32. (contributed by
Niels Kristian Bech Jensen)
- added conditional compilation statementsfor the mingw32 environment in
drvrfile.c because mingw32 does not include the ftello and fseeko functions.
(contributed by Niels Kristian Bech Jensen)
- fixed a potential bug in ffcpcl (routine to copy a column from one table
to another table) when dealing with the rare case of a '0X' column (zero
length bit column).
- fixed an issue in the routines that update or modify string-valued
keyword values, as a result of the change to ffc2s in the previous
release. These routines would exit with a 204 error status if the
current value of the keyword to be updated or modified is null.
- fixed typo in the previous modification that was intended to ignore
numerical overflows in Hcompress when decompressing an image.
- moved the 'startcol' static variable out of the ffgcnn routine and
instead added it as a member of the 'FITSfile' structure that is defined
in fitsio.h. This removes a possible race condition in ffgcnn in
multi-threaded environments.
Version 3.33 - 14 Feb 2013
- modified the imcomp_decompress_tile routine to ignore any numerical
overflows that might occur when using Hcompress to decompress the
image. If Hcompress is used in its 'lossy' mode, the uncompressed
image pixel values may slightly exceed the range of an integer*2
variable. This is generally of no consequence, so we can safely ignore
any overflows in this case and just clip the values to the legal range.
- the default tiling pattern when writing a tile-compressed image
has been changed. The old behavior was to compress the whole image
as one single large tile. This is often not optimal when dealing
with large images, so the new default behavior is to treat each
row of the image as one tile. This is the same default behavior
as in the standalone fpack program. The default tile size can
be overridden by calling fits_set_tile_dim.
- fixed bug that resulted in a corrupted output FITS image when
attempting to write a float or double array of values to a
tile-compressed integer data type image. CFITSIO does not support
implicit data type conversion in this case and now correctly
returns an appropriate error status.
- modified ricecomp.c to define the nonzero_count lookup table as an
external variable, rather then dynamically allocating it within the
3 routines that use it. This simplifies the code and eliminates the
need for special thread locking and unlocking statements. (Thanks to
Lars Kr. Lundin for this suggestion).
- modified how the uncompressed size of a gzipped file is computed in the
mem_compress_open routine in drvrmem.c. Since gzip only uses 4 bytes
in the compressed file header to store the original file size, one may
need to apply a modulo 2^32 byte correction in some cases. The logic
here was modified to allow for corner cases (e.g., very small files, and
when running on 32-bit platforms that do not support files larger than
2^31 bytes in size).
- added new public routine to construct a 80 keyword record from the 3 input
component strings, i.e, the keyword name string, the value string, and
the comment string: fits_make_key/ffmkky. (This was already an undocumented
internal routine in previous versions of CFITSIO).
- modified ffc2s so that if the input keyword value string is a null string,
then it will return a VALUE_UNDEFINED (204) status value. This makes it
consistent with the behavior when attempting to read a null keyword
(which has no value) as a logical or as a number (which also returns
the 204 error). This should only affect cases where the header keyword
does not have an equal sign followed by a space character in columns 9
and 10 of the header record.
- Changed the "char *" parameter declarations to "const char *" in many
of the routines (mainly the routines that modify or update keywords) to
avoid compiler warnings or errors from C++ programs that tend to be more
rigorous about using "const char *" when appropriate.
- added support for caching uncompressed image tiles, so that the tile does
not need to be uncompressed again if the application program wants
to read more data from the same tile. This required changes to the
main FITS file structure that is defined in fitsio.h, as well as
changes to imcompress.c.
- enhanced the previous modification to drvrfile.c to handle additional user
cases when running in the HEASARC's Hera environment.
Version 3.32 - Oct 2012
- fixed flaw in the way logical columns (TFORM = 'L') in binary tables
were read which caused an illegal value of 1 in the column to be interpreted
as a 'T' (TRUE) value.
- extended the column filtering syntax in the CFITSIO file name parser to
enable users and scripts to append new COMMENT or HISTORY keyword into the
header of the filtered file (provided by Craig Markwardt). For example,
fcopy "infile.fits[col #HISTORY='Processed on 2012-10-05']" outfile.fits
will append this header keyword: "HISTORY Processed on 2012-10-05"
- small change to the code that opens and reads an ASCII region file to
return an error if the file is empty.
- fixed obscure sign propagation error when attempting to read the
uncompressed size of a gzipped FITS file. This resulted in a memory
allocation error if the gzipped file had an uncompressed file
size between 2^31 and 2^32 bytes. Fix supplied by Gudlaugur Johannesson
(Stanford).
Version 3.31 - 18 July 2012
- enhanced the CFITSIO column filtering syntax to allow the comma, in addition
to the semi-colon, to be used to separate clauses, for example:
[col X,Y;Z = max(X,Y)]. This was done because users are not allowed to
enter the semi-colon character in the on-line Hera data processing
system due to computer security concerns.
- enhanced the CFITSIO extended filename syntax to allow specifying image