This commit is contained in:
max
2026-08-11 17:11:30 +01:00
parent 3229a69a80
commit abc8d082a0

View File

@@ -11,11 +11,12 @@ foreach (scandir('./images') as $inode) {
continue; continue;
} }
$file_name = basename($inode); $file_name = basename($inode);
$image_path = "./images/$file_name";
$thumbnail_path = "./images/thumbnails/$file_name"; $thumbnail_path = "./images/thumbnails/$file_name";
if ( ! file_exists($thumbnail_path)) { if ( ! file_exists($thumbnail_path)) {
$image_bytes = file_get_contents("./images/$file_name"); $image_bytes = file_get_contents($image_path);
if ( ! $image_bytes) { if ( ! $image_bytes) {
echo "Warning: couldn't get contents of file $file_name\n"; echo "Warning: couldn't get contents of file $file_name\n";
@@ -66,7 +67,7 @@ foreach (scandir('./images') as $inode) {
</a> </a>
</div> </div>
', ',
$inode, $image_path,
$thumbnail_path, $thumbnail_path,
$alt_text ?: '' $alt_text ?: ''
); );