Jump to content

images don't show


rolspace.net
 Share

Recommended Posts

Hi all

I have a problem here. I created a gallery with 240 pictures. Created an images field with no maximum amount (0). Unfortunately, only 98 of the 240 images show on the website. Any idea what I possibly could have done wrong? Thanks for your help!

<?php 
        foreach ($page->images as $image) {
        $options = array(
          'quality' => 90,
          'upscaling' => false
        );
        $thumb = $image->size(250, 250, $options);
      ?>
        <div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-6 foto">
         <a href="<?= $image->url ?>" data-lightbox="lightbox" >
          <img src="<?= $thumb->url ?>" alt="" >
         </a>
        </div>
      <?php } ?>

 

Link to comment
Share on other sites

Quote

only 98 of the 240 images show on the website.

240 images are too many to show on a single webpage and can choke the browser and eat away too many resources.

Try 40 or 60 images per webpage and use pagination.

Link to comment
Share on other sites

6 hours ago, kongondo said:

What does echo $page->images->count() return;?

it returned 96. Then I added the files like 10 at once instead of 50 and then it worked again. for a while. up to 162 images. Then the same again. I can add more pictures, save the page, leave and come back to it and the images are gone (the ones I just uploaded). this is really weird...

Link to comment
Share on other sites

Have a look in the file system for the 'created' image thumbs (/site/assets/files/1234/, where 1234 is the ID of the page with the images. Were the 250 by 250 image thumbs created correctly or they are not viewable/blank? Also, what size are the images you are uploading? 

Link to comment
Share on other sites

13 hours ago, kongondo said:

Have a look in the file system for the 'created' image thumbs (/site/assets/files/1234/, where 1234 is the ID of the page with the images. Were the 250 by 250 image thumbs created correctly or they are not viewable/blank? Also, what size are the images you are uploading? 

Well, it seems that the problem starts much earlier. I can upload around 150 images (width 1600px, size between 300 and 600KB), after that, processwire does not store them anymore.....

Link to comment
Share on other sites

That's a bug in PW that's in there since years. I once tried to make sense of it but after hours of try and error I gave up. If you upload a bunch of images (only drag and drop), sometimes images get lost on the way, though they're uploaded they're not saved in DB. All issue reports end up having "not reproducible, needs more information, discussion". Ryan's too busy with new features than trying to track down those (understandable though if you can't reproduce).

Link to comment
Share on other sites

6 minutes ago, Soma said:

That's a bug in PW that's in there since years. I once tried to make sense of it but after hours of try and error I gave up. If you upload a bunch of images (only drag and drop), sometimes images get lost on the way, though they're uploaded they're not saved in DB. All issue reports end up having "not reproducible, needs more information, discussion". Ryan's too busy with new features than trying to track down those (understandable though if you can't reproduce).

Thanks for the info, Soma. What would you suggest? Just try and hope it works at some point? do you have a workaround idea? Several image fields?

Link to comment
Share on other sites

Well can't say without problems, cause the editor gets really unresponsive and it doesn't save anymore... well.

Edit: well looks like it was hanging a lot and after couple minutes I was able to edit again as it seems it finally deleted all files, but it's not made for such large amounts.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...