|
59 | 59 | // Check collage configuration |
60 | 60 | if ($_POST['style'] === 'collage') { |
61 | 61 | if ($config['collage']['take_frame'] !== 'off') { |
62 | | - if (is_dir(COLLAGE_FRAME)) { |
63 | | - $errormsg = 'Frame not set! ' . COLLAGE_FRAME . ' is a path but needs to be a png!'; |
| 62 | + $frame = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $config['collage']['frame']); |
| 63 | + if (is_dir($frame)) { |
| 64 | + $errormsg = 'Frame not set! ' . $frame . ' is a path but needs to be a png!'; |
64 | 65 | logErrorAndDie($errormsg); |
65 | 66 | } |
66 | 67 |
|
67 | | - if (!file_exists(COLLAGE_FRAME)) { |
68 | | - $errormsg = 'Frame ' . COLLAGE_FRAME . ' does not exist!'; |
| 68 | + if (!file_exists($frame)) { |
| 69 | + $errormsg = 'Frame ' . $frame . ' does not exist!'; |
69 | 70 | logErrorAndDie($errormsg); |
70 | 71 | } |
71 | 72 | } |
72 | 73 |
|
73 | 74 | if ($config['textoncollage']['enabled']) { |
74 | | - if (is_dir(realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . TEXTONCOLLAGE_FONT))) { |
75 | | - $errormsg = 'Font not set! ' . TEXTONCOLLAGE_FONT . ' is a path but needs to be a ttf!'; |
| 75 | + $font = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $config['textoncollage']['font']); |
| 76 | + if (is_dir($font)) { |
| 77 | + $errormsg = 'Font not set! ' . $font . ' is a path but needs to be a ttf!'; |
76 | 78 | logErrorAndDie($errormsg); |
77 | 79 | } |
78 | 80 |
|
79 | | - if (!file_exists(realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . TEXTONCOLLAGE_FONT))) { |
80 | | - $errormsg = 'Font ' . TEXTONCOLLAGE_FONT . ' does not exist!'; |
| 81 | + if (!file_exists($font)) { |
| 82 | + $errormsg = 'Font ' . $font . ' does not exist!'; |
81 | 83 | logErrorAndDie($errormsg); |
82 | 84 | } |
83 | 85 | } |
84 | 86 | } else { |
85 | 87 | // Check picture configuration |
86 | 88 | if ($config['picture']['take_frame']) { |
87 | | - if (is_dir($picture_frame)) { |
88 | | - $errormsg = 'Frame not set! ' . $picture_frame . ' is a path but needs to be a png!'; |
| 89 | + $frame = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $config['picture']['frame']); |
| 90 | + if (is_dir($frame)) { |
| 91 | + $errormsg = 'Frame not set! ' . $frame . ' is a path but needs to be a png!'; |
89 | 92 | logErrorAndDie($errormsg); |
90 | 93 | } |
91 | 94 |
|
92 | | - if (!file_exists($picture_frame)) { |
93 | | - $errormsg = 'Frame ' . $picture_frame . ' does not exist!'; |
| 95 | + if (!file_exists($frame)) { |
| 96 | + $errormsg = 'Frame ' . $frame . ' does not exist!'; |
94 | 97 | logErrorAndDie($errormsg); |
95 | 98 | } |
96 | 99 | } |
97 | 100 |
|
98 | 101 | if ($config['textonpicture']['enabled']) { |
99 | | - if (is_dir(realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $fontpath))) { |
100 | | - $errormsg = 'Font not set! ' . $fontpath . ' is a path but needs to be a ttf!'; |
| 102 | + $font = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $fontpath); |
| 103 | + if (is_dir($font)) { |
| 104 | + $errormsg = 'Font not set! ' . $font . ' is a path but needs to be a ttf!'; |
101 | 105 | logErrorAndDie($errormsg); |
102 | 106 | } |
103 | 107 |
|
104 | | - if (!file_exists(realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $fontpath))) { |
105 | | - $errormsg = 'Font ' . $fontpath . ' does not exist!'; |
| 108 | + if (!file_exists($font)) { |
| 109 | + $errormsg = 'Font ' . $font . ' does not exist!'; |
106 | 110 | logErrorAndDie($errormsg); |
107 | 111 | } |
108 | 112 | } |
|
0 commit comments