Skip to content

Commit 2264aa6

Browse files
committed
fix
1 parent ae83ac2 commit 2264aa6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Module/Admin/View/Overview/Overview.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
namespace Stu\Module\Admin\View\Overview;
66

7-
use Stu\Component\Image\ImageCreationInterface;
87
use Stu\Module\Config\StuConfigInterface;
98
use Stu\Module\Control\GameControllerInterface;
109
use Stu\Module\Control\ViewControllerInterface;
1110

1211
final class Overview implements ViewControllerInterface
1312
{
1413
public function __construct(
15-
private readonly ImageCreationInterface $imageCreation,
1614
private readonly StuConfigInterface $config
1715
) {}
1816

@@ -31,19 +29,20 @@ private function setWeatherReport(GameControllerInterface $game): void
3129
// load event map from file
3230
$historyFolder = $this->config->getGameSettings()->getTempDir() . '/history';
3331

32+
$fileName = $historyFolder . '/ionstorm_map_layer_2.gif';
3433
// check if file exists
35-
if (!file_exists($historyFolder . '/ionstorm_map_layer_2.gif')) {
34+
if (!file_exists($fileName)) {
3635
return;
3736
}
3837

39-
$graph = imagecreatefromgif($historyFolder . '/ionstorm_map_layer_2.gif');
40-
if ($graph === false) {
38+
$fileContent = file_get_contents($fileName);
39+
if ($fileContent === false) {
4140
return;
4241
}
4342

4443
$game->setTemplateVar(
4544
'ION_STORM_MAP',
46-
'<img src="data:image/gif;base64,' . base64_encode(file_get_contents($historyFolder . '/ionstorm_map_layer_2.gif')) . '"/>'
45+
'<img src="data:image/gif;base64,' . base64_encode($fileContent) . '"/>'
4746
);
4847
}
4948
}

0 commit comments

Comments
 (0)