Check that the logo images were actually created before giving a message that they were. If they arent, give an error message and a possible reason

This commit is contained in:
james 2007-11-15 16:58:31 +00:00
parent 907c394e8c
commit fb9a23a0e2

View File

@ -42,13 +42,22 @@ if($_POST['action']=="addimage")
system("convert -sample 500 \"".$_FILES['image']['tmp_name']."\" ../data/logo-500.gif");
system("convert \"".$_FILES['image']['tmp_name']."\" ../data/logo.gif");
if(file_exists("../data/logo-100.gif") && file_exists("../data/logo-200.gif") && file_exists("../data/logo-500.gif") && file_exists("../data/logo.gif"))
echo happy(i18n("GIF Images successfully created"));
else
echo error(i18n("Error creating GIF Image files. Make sure 'convert' binary is in your path, and that 'system' function can be used"));
echo notice(i18n("Creating sized logo files:<br />&nbsp;logo-100.png<br />&nbsp;logo-200.png<br />&nbsp;logo-500.png<br />&nbsp;logo.png"));
//make some PNG's as well
system("convert -sample 100 \"".$_FILES['image']['tmp_name']."\" ../data/logo-100.png");
system("convert -sample 200 \"".$_FILES['image']['tmp_name']."\" ../data/logo-200.png");
system("convert -sample 500 \"".$_FILES['image']['tmp_name']."\" ../data/logo-500.png");
system("convert \"".$_FILES['image']['tmp_name']."\" ../data/logo.png");
echo happy(i18n("Logo Image successfully uploaded"));
if(file_exists("../data/logo-100.png") && file_exists("../data/logo-200.png") && file_exists("../data/logo-500.png") && file_exists("../data/logo.png"))
echo happy(i18n("PNG Images successfully created"));
else
echo error(i18n("Error creating PNG Image files. Make sure 'convert' binary is in your path, and that 'system' function can be used"));
}
else
{