I may just overlook sth. but I wrote a really easy gallery with the php code below. I always get a blank space with no picture an no div container in the second row on the first column. All pictures load and display correctly, i got no errors or warnings. I just have a blank space.
I tried to filter empty or hidden files and I changed the number images per row. But nothing worked. What else can i look for? And i tried to var_dump $images. Everything seems right there. 17 Pictures with the correct name and path.
my css just has a float:left to display the pictures.
<?php
$dir = __DIR__ . DIRECTORY_SEPARATOR . "gallery" . DIRECTORY_SEPARATOR;
$images = glob($dir . "*.{jpg,jpeg,png}", GLOB_BRACE);
?>
<!DOCTYPE html>
<html lang="de">
<head>
</head>
<body>
<h1>Gallery</h1>
<div class="col-lg-12" id="con">
<?php
foreach ($images as $i) {
printf("<div class='col-lg-4' id='gallery'><img src='gallery/%s' class='img-thumbnail'/></div>", basename($i));
}?>
</div>
</body>
</html>
I just want 3 pictures in a row with no blank space in the second row, first column