0

I have a page in my site that uses a MySQL database and a PHP script (phpThumb) to create small (150px-wide) images from larger images. When I ask it to display this page:

https://newtonartassociation.com/membership/admin/mb_test.php

some of the images come up as broken.

If I reload the page, some of the broken images get filled in but others usually break. For some reason it is worse in Firefox than Chrome. Note that (1) there are more broken images at the far end of the page than at the beginning; and (2) if I invert the list order, I still get more broken images at the far end, so it doesn't seem to be the individual images that are causing this.

The only change since the last time I ran this code is that I'm now running PHP 7.0 instead of 5.6.

I got the latest version of phpThumb and I also tried reverting to PHP 5.6 but got the same result.

<?php

  $result_art = $mysqli->query("SELECT * FROM eventart WHERE (event = 'motherbrook') ORDER BY artist ASC");

  $row_result_art = mysqli_fetch_assoc($result_art);

  require_once('../resize/phpThumb.config.php');

do { 

$image = $row_result_art['artworkid'];

echo '<img src="'.htmlspecialchars(phpThumbURL('src=show_images/'.$image.'&w=150', '../resize/phpThumb.php')).'"><p>';

} while ($row_result_art = mysqli_fetch_assoc($result_art)); 

?>

If I right-click on a broken image and select reload image (Firefox) or open in a new tab (Chrome), I see the image and it then appears in the full list, but I can't instruct my client to do this for every broken image.

Serghei Leonenco
  • 3,478
  • 2
  • 8
  • 16

1 Answers1

0

You are uploading too many images at the same time. Browsers save data. Cut the pictures into pieces and show them if the user wants to see them.

  • Unfortunately, this is going to be a judge's page, so the judges have to see all the images at first. Then they can focus on a few. One of the reasons for posting thumbnails is so the judges can decide which images to look at in detail. In the final version, the judge will be able to click on the thumbnail they want to look at and see an enlarged version of it. – JASBoston Aug 01 '19 at 01:49
  • Upload images with Javascript (ajax). or use this or similar if possible: https://github.com/verlok/lazyload – Muhammed Alper Uslu Aug 01 '19 at 02:04
  • I found a solution for a different problem. take a look at my answer : https://stackoverflow.com/questions/56654798/my-domain-return-error-for-texture-load-image-url – Muhammed Alper Uslu Aug 01 '19 at 02:07