Skip to content

Commit ef915de

Browse files
committed
Fix ImageMagick warning message.
1 parent cc8b484 commit ef915de

File tree

6 files changed

+71
-38
lines changed

6 files changed

+71
-38
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# You should have received a copy of the GNU General Public License
2525
# along with SCAMP. If not, see <http://www.gnu.org/licenses/>.
2626
#
27-
# Last modified: 26/03/2025
27+
# Last modified: 09/04/2025
2828
#
2929
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3030

@@ -33,7 +33,7 @@ define([AC_CACHE_LOAD],)
3333
define([AC_CACHE_SAVE],)
3434

3535
# This is your standard AstrOmatic source code...
36-
AC_INIT(SCAMP, 2.14.0, [astromatic@astromatic.iap.fr],
36+
AC_INIT(SCAMP, 2.14.0, [astromatic@astromatic.net],
3737
scamp, [http://astromatic.net/software/scamp])
3838
AC_CONFIG_MACRO_DIR([m4])
3939
AC_CONFIG_AUX_DIR(autoconf)

doc/src/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
# built documents.
6868
#
6969
# The short X.Y version.
70-
version = '2.13.2'
70+
version = '2.14.0'
7171
# The full version, including alpha/beta/rc tags.
72-
release = '2.13.2'
72+
release = '2.14.0'
7373

7474
# The language for content autogenerated by Sphinx. Refer to documentation
7575
# for a list of supported languages.

src/cplot.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
*
88
* This file part of: SCAMP
99
*
10-
* Copyright: (C) 2002-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
10+
* Copyright: (C) 2002-2021 IAP/CNRS/SorbonneU
11+
* (C) 2021-2023 CFHT/CNRS
12+
* (C) 2023-2025 CEA/AIM/UParisSaclay
1113
*
1214
* License: GNU General Public License
1315
*
@@ -22,7 +24,7 @@
2224
* You should have received a copy of the GNU General Public License
2325
* along with SCAMP. If not, see <http://www.gnu.org/licenses/>.
2426
*
25-
* Last modified: 10/10/2010
27+
* Last modified: 09/04/2025
2628
*
2729
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2830

@@ -103,8 +105,8 @@ INPUT Number of plots along the x axis,
103105
device number.
104106
OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
105107
NOTES .
106-
AUTHOR E. Bertin (IAP)
107-
VERSION 10/09/2009
108+
AUTHOR E. Bertin (CEA/AIM/UParisSaclay)
109+
VERSION 09/04/2025
108110
***/
109111
int cplot_init(int nx, int ny, cplotenum cplottype)
110112
{
@@ -124,10 +126,12 @@ int cplot_init(int nx, int ny, cplotenum cplottype)
124126
&& (prefs.cplot_device[dev-1] == CPLOT_PNG
125127
|| prefs.cplot_device[dev-1] == CPLOT_JPEG))
126128
{
127-
sprintf(str, "convert -geometry \"%dx%d\" -antialias %s %s",
129+
sprintf(str, "%s %s -geometry \"%dx%d\" -antialias %s",
130+
prefs.cplot_antialiasexec,
131+
plotfilename,
128132
prefs.cplot_res[0]? prefs.cplot_res[0] : CPLOT_DEFRESX,
129133
prefs.cplot_res[1]? prefs.cplot_res[1] : CPLOT_DEFRESY,
130-
plotfilename, plotfilename);
134+
plotfilename);
131135
system(str);
132136
}
133137

src/define.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
*
88
* This file part of: SCAMP
99
*
10-
* Copyright: (C) 2002-2018 IAP/CNRS/UPMC
10+
* Copyright: (C) 2002-2021 IAP/CNRS/SorbonneU
11+
* (C) 2021-2023 CFHT/CNRS
12+
* (C) 2023-2025 CEA/AIM/UParisSaclay
1113
*
1214
* License: GNU General Public License
1315
*
@@ -22,7 +24,7 @@
2224
* You should have received a copy of the GNU General Public License
2325
* along with SCAMP. If not, see <http://www.gnu.org/licenses/>.
2426
*
25-
* Last modified: 03/05/2018
27+
* Last modified: 09/04/2025
2628
*
2729
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2830

@@ -37,15 +39,15 @@
3739

3840
/*------------------------ what, who, when and where ------------------------*/
3941

40-
#define BANNER "SCAMP"
41-
#define MYVERSION VERSION
42-
#define COPYRIGHT "2010-2018 Sorbonne Université/Université de Bordeaux/CNRS"
43-
#define DISCLAIMER BANNER " comes with ABSOLUTELY NO WARRANTY\n" \
42+
#define BANNER "SCAMP"
43+
#define MYVERSION VERSION
44+
#define COPYRIGHT "2002-2025 IAP/CNRS/SorbonneU/CFHT/CEA/AIM/UParisSaclay"
45+
#define DISCLAIMER BANNER " comes with ABSOLUTELY NO WARRANTY\n" \
4446
"You may redistribute copies of " BANNER "\n" \
4547
"under the terms of the GNU General Public License."
46-
#define AUTHORS "Emmanuel BERTIN <bertin@iap.fr> and Sébastien Serre <[email protected]>"
47-
#define WEBSITE "http://astromatic.net/software/scamp"
48-
#define INSTITUTE "IAP http://www.iap.fr"
48+
#define AUTHORS "Emmanuel BERTIN <bertin@universite-paris-saclay.fr> and Sébastien Serre <[email protected]>"
49+
#define WEBSITE "http://astromatic.net/software/scamp"
50+
#define INSTITUTE "AIM https://irfu.cea.fr/dap/"
4951

5052
/*----------------------------- Physical constants --------------------------*/
5153

src/prefs.c

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* This file part of: SCAMP
99
*
10-
* Copyright: (C) 1998-2021 IAP/CNRS/SorbonneU
10+
* Copyright: (C) 2002-2021 IAP/CNRS/SorbonneU
1111
* (C) 2021-2023 CFHT/CNRS
1212
* (C) 2023-2025 CEA/AIM/UParisSaclay
1313
*
@@ -24,7 +24,7 @@
2424
* You should have received a copy of the GNU General Public License
2525
* along with SCAMP. If not, see <http://www.gnu.org/licenses/>.
2626
*
27-
* Last modified: 27/03/2025
27+
* Last modified: 09/04/2025
2828
*
2929
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
3030

@@ -65,6 +65,7 @@
6565
#include "fitswcs.h"
6666

6767
int findkeys(char *str, char key[][32], int mode);
68+
void get_magick(void);
6869

6970
prefstruct prefs;
7071

@@ -485,8 +486,7 @@ Update various structures according to the prefs.
485486
void useprefs(void)
486487

487488
{
488-
FILE *testfile;
489-
char teststr[80],str[80],
489+
char str[80],
490490
*pstr;
491491
int i, flag;
492492
#ifdef USE_THREADS
@@ -681,19 +681,9 @@ void useprefs(void)
681681
if (flag && prefs.ncplot_name!=prefs.ncplot_type)
682682
error(EXIT_FAILURE, "*Error*: CHECKPLOT_NAME(s) and CHECKPLOT_TYPE(s)",
683683
" are not in equal number");
684-
/* Deactivate antialiasing if the convert tool is not available */
685-
if (prefs.cplot_flag && prefs.cplot_antialiasflag)
686-
{
687-
if ((testfile=popen("convert", "r")))
688-
{
689-
fgets(teststr, 80, testfile);
690-
if (!strstr(teststr, "ImageMagick"))
691-
prefs.cplot_antialiasflag = 0;
692-
pclose(testfile);
693-
}
694-
else
695-
prefs.cplot_antialiasflag = 0;
696-
}
684+
/* Deactivate antialiasing if the magick/convert tool is not available */
685+
if (flag)
686+
get_magick();
697687

698688
/* S/N thresholds */
699689
if (prefs.sn_thresh[1]<prefs.sn_thresh[0])
@@ -703,6 +693,40 @@ void useprefs(void)
703693
}
704694

705695

696+
/***i** get_magick ***********************************************************
697+
PROTO void get_magick(void)
698+
PURPOSE Get the name of an ImageMagick executable
699+
INPUT -.
700+
OUTPUT Executable filename.
701+
NOTES -.
702+
AUTHOR E. Bertin (CEA/AIM/UParisSaclay)
703+
VERSION 09/04/2025
704+
*/
705+
void get_magick(void) {
706+
FILE *testfile;
707+
static char exec_names[][MAXCHAR] = {"magick", "convert", ""},
708+
teststr[80];
709+
int i;
710+
711+
prefs.cplot_antialiasexec = NULL;
712+
for (i=0; *exec_names[i]; i++) {
713+
sprintf(teststr, "%s 2>/dev/null", exec_names[i]);
714+
if (!(testfile=popen(teststr, "r")))
715+
continue;
716+
fgets(teststr, 80, testfile);
717+
pclose(testfile);
718+
if (!strstr(teststr, "ImageMagick"))
719+
continue;
720+
prefs.cplot_antialiasexec = exec_names[i];
721+
break;
722+
}
723+
724+
if (!prefs.cplot_antialiasexec) {
725+
prefs.cplot_antialiasflag = 0;
726+
warning("ImageMagick package not found: ", "anti-aliasing de-activated in plots");
727+
}
728+
}
729+
706730
/********************************* endprefs *********************************/
707731
/*
708732
Mostly free memory allocate for static arrays.

src/prefs.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
*
88
* This file part of: SCAMP
99
*
10-
* Copyright: (C) 2002-2023 IAP/CNRS/SorbonneU/CEA/UParisSaclay
10+
* Copyright: (C) 2002-2021 IAP/CNRS/SorbonneU
11+
* (C) 2021-2023 CFHT/CNRS
12+
* (C) 2023-2025 CEA/AIM/UParisSaclay
1113
*
1214
* License: GNU General Public License
1315
*
@@ -22,7 +24,7 @@
2224
* You should have received a copy of the GNU General Public License
2325
* along with SCAMP. If not, see <http://www.gnu.org/licenses/>.
2426
*
25-
* Last modified: 05/12/2023
27+
* Last modified: 09/04/2025
2628
*
2729
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2830

@@ -215,6 +217,7 @@ typedef struct
215217
int cplot_res[2]; /* X,Y check-plot resolution */
216218
int ncplot_res; /* nb of params */
217219
int cplot_antialiasflag; /* Anti-aliasing on/off */
220+
char *cplot_antialiasexec; /* Executable filename for anti-aliasing */
218221
int stats_maxmeshsize; /* Max mesh size for stats */
219222
/* Check-images */
220223
checkenum check_type[MAXCHECK]; /* check-image types */

0 commit comments

Comments
 (0)