I want to create Gallery using Photoswipe plugin but I want to show thumbs and images automatically form folder. Photoswipe requires the size of the image, so I want the script to take the size of each image.
Pictures in folder are numbered from 0-14 and it showing images but I don't know how to take size of each image from gallery/ and put it to: data-size="'.$imageSize.'":
<?php
$dir="gallery/";
$thumbsDir="gallery/thumbs/";
for($i=0; $i<=14; $i++)
{
echo
'<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
<a href="'.$dir.$i.'.jpg" itemprop="contentUrl" data-size="'.$imageSize.'" data-index="'.$i.'">
<img src="'.$thumbsDir.$i.'.jpg" width="412px" itemprop="thumbnail" class="img-responsive img-thumbnail">
</a>
</figure>';
}
?>
This should look like this: data-size="1920x1080".