I have been playing with the latest AmpProject's image creation parameters and delighted with the results.
It is no longer necessary to create thumbnails because AMP original images can be shrunk to the containing folder and without having to specify any image dimensions!
I created about a hundred thumbnails both from the thumbnails and the original images and the rendering difference is negligible!
The work is in progress and I have to sort out how to align the thumbnails
Script to obtain an array of thumbnails:
$path = $_SERVER['DOCUMENT_ROOT'] .'/subs/thumb/*.*';
$imgs = glob($path);
$imgs = array_slice($imgs, mt_rand(0,88), 101);
Functiont to display thumbnail:
function thumbnail($img, $title='Yes we have no title')
$result = <<< ____TMP
<div class="dib thb contain cll fll">
class = "contain"
layout = "fill"
HTML Script to display thumbnails:
$path = '/var/www/ORIGINAL-IMAGES/';
$len = strlen( $path );
foreach( $imgs as $id => $img):
$title = substr($img, $len);
$img = 'https://www.johns-jokes.com/afiles/images/'
echo thumbnail($img, $title);
Can you remember the good old days when thumbnails had to be created and the effort involved trying to render the images