@@ -7087,7 +7087,7 @@ namespace cimg_library {
70877087 //! Return the factorial of n.
70887088 inline double factorial(const int n) {
70897089 if (n<0) return cimg::type<double>::nan();
7090- if (n<2) return 1;
7090+ if (n<12) { const double tab[] = { 1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800 }; return tab[n]; }
70917091 double res = 2;
70927092 for (int i = 3; i<=n; ++i) res*=i;
70937093 return res;
@@ -62841,8 +62841,14 @@ namespace cimg_library {
6284162841 TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,bpp);
6284262842 TIFFSetField(tif,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);
6284362843 TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,photometric);
62844- TIFFSetField(tif,TIFFTAG_COMPRESSION,compression_type==2?COMPRESSION_JPEG:
62845- compression_type==1?COMPRESSION_LZW:COMPRESSION_NONE);
62844+ TIFFSetField(tif,TIFFTAG_COMPRESSION,
62845+ compression_type==6?COMPRESSION_ZSTD:
62846+ compression_type==5?COMPRESSION_WEBP:
62847+ compression_type==4?COMPRESSION_JBIG:
62848+ compression_type==3?COMPRESSION_LZW:
62849+ compression_type==2?COMPRESSION_LZMA:
62850+ compression_type==1?COMPRESSION_JPEG:
62851+ COMPRESSION_NONE);
6284662852 rowsperstrip = TIFFDefaultStripSize(tif,rowsperstrip);
6284762853 TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP,rowsperstrip);
6284862854 TIFFSetField(tif,TIFFTAG_FILLORDER,FILLORDER_MSB2LSB);
0 commit comments