Added code to auto-detect ImageMagick

SVN revision: 2024
This commit is contained in:
Stefan Ritt 2008-01-31 16:20:02 +00:00
parent 23e8f51537
commit 11ea3914f5

View File

@ -208,7 +208,8 @@ struct in_addr rem_addr;
char rem_host[256];
char rem_host_ip[256];
int _sock;
BOOL use_keepalive, enable_execute = FALSE, fckedit_exist;
BOOL use_keepalive, enable_execute = FALSE;
BOOL fckedit_exist, image_magick_exist;
int verbose, _current_message_id;
int _logging_level;
@ -22029,9 +22030,12 @@ int create_thumbnail(LOGBOOK * lbs, char *file_name)
{
char str[MAX_PATH_LENGTH], cmd[2*MAX_PATH_LENGTH], thumb_size[256];
if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size)))
if (!image_magick_exist)
return 0;
if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size)))
strcpy(thumb_size, "300>");
if (!chkext(file_name, ".ps") && !chkext(file_name, ".pdf") && !chkext(file_name, ".eps") &&
!chkext(file_name, ".gif") && !chkext(file_name, ".jpg") && !chkext(file_name, ".jpeg") &&
!chkext(file_name, ".png") && !chkext(file_name, ".ico") && !chkext(file_name, ".tif"))
@ -26776,6 +26780,12 @@ void server_loop(void)
if (fckedit_exist)
eprintf("FCKedit detected\n");
/* check for ImageMagick */
subst_shell("convert -version", str, sizeof(str));
image_magick_exist = (strstr(str, "ImageMagick") != NULL);
if (image_magick_exist)
eprintf("ImageMagick detected\n");
/* build logbook indices */
if (!verbose && !running_as_daemon)
eprintf("Indexing logbooks ... ");