add config setting for image bg

This commit is contained in:
Carly Ho 2023-06-29 20:04:33 -05:00
parent 60cf2fe1c0
commit d0ceae1e3a
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,11 @@ define("DB_LOCATION", "./kudos.db");
// Something to show in page titles. You could change this to "Kudos for [My Name]", etc.
define("SITE_NAME", "Kudos");
// This changes the image bgcolor! you probably want it to be something that the text will show up on.
// use "none" for transparent, but this might cause it to not show up if the background is the same color
// as the text.
define("IMAGE_BG", "white");
// Text Drawing Settings
$id = new ImagickDraw();
$id->setFont("./fonts/open-sans.ttf");

View File

@ -50,7 +50,7 @@ if (array_key_exists('give', $_GET)) {
$image = new Imagick();
// writes the number
$id->annotation(50, 50, $count);
$image->newImage(100, 500, "white");
$image->newImage(100, 500, IMAGE_BG);
$image->setImageFormat("png");
$image->drawImage($id);
$image->trimImage(0);