Jump to content

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 } ?>

 

Share this post


Link to post
Share on other sites

Could be your server is running out of memory maybe? No white screens or errors? Just guessing. See this thread as well.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

it does actually render the rest of the website correctly. It just stops after 98 pictures. and by the way, it's only thumbnails...

Share this post


Link to post
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...

Share this post


Link to post
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? 

Share this post


Link to post
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.....

Share this post


Link to post
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).

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

No. Upload via classic upload, or just 2-3 at a time.

Share this post


Link to post
Share on other sites
16 minutes ago, Soma said:

No. Upload via classic upload, or just 2-3 at a time.

it doesn't work. even if i go one by one. it stops at 162 images...... 

Share this post


Link to post
Share on other sites

I just uploaded 300 images without problem. Sorry don't know.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
2 hours ago, rolisx said:

What would you suggest?

Is this a personal site? You can use the API to upload images as well as resize them. 

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, rolisx said:

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 might be relevant:

 

  • Like 2

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By humanafterall
      I'm using some Custom fields for images: 
      https://processwire.com/blog/posts/pw-3.0.142/#custom-fields-for-files-images

      When I save the page, and return the fields are blank. When I re-add the text to the fields and save again then the fields save as expected.

      I know this is stated as being quite experimental but it's super useful feature I'd love to get working correctly.
      I have fields that are CKEditor fields but have overidden this on the image specific template. I've also tried it with regular text fields and I get the same bug.
      (currently using Processwire 3.0.155)
      **UPDATE**
      I've found this issue is specific to editing on pages using the PageTable fieldtype. The fields are not saving when I save the page in the PageTable.
    • By Robin S
      Displays image tags overlaid on the thumbnail using customisable colours. This makes it easier to see which images have which tags without needing to open the edit pane for individual images or changing to the list view.
      Screenshot

      Usage
      Enable tags for one or more image fields. Install the Image Thumbnail Tags module. Optionally configure colours for any of your tags.
       
      https://github.com/Toutouwai/ImageThumbnailTags
      https://modules.processwire.com/modules/image-thumbnail-tags/
    • By EyeDentify
      Hello dear PW gurus.

      I have stumbled over a strange error that i all of sudden got when trying to upload an image to a images field on a page.
      There where images allready stored in the field that i wanted to keep, but during the upload the error apear and after that all images are gone from the field and i can´t upload any, i just get the error every time.
      I am running ProcessWire 3.0.153 dev.
      Update:
      After looking in the assets folder i find the folder for the page and the image files seems to be there including the ones i tried to upload when the error occured.
      But they don´t show up in the images field in the page editor.
       
      The error reported:
       
      SQLSTATE[01000]: Warning: 1265 Data truncated for column 'ratio' at row 1 And here is a screenshot of the event:

      The TracyDebugger Error reporting:

      I hope you fine folks could point me in a direction.
      But it seems our old pal set_time_limit() is back.

      Regards, EyeDentify
    • By Peter Knight
      If an image is added to a site via the rich text field, do we have a way to apply a custom wrapper or mini template to it?
      IE I want to apply some markup srcset to some user added images. I can only seem to achieve this when the image markup is in the template itself.
      https://github.com/rolandtoth/MarkupSrcSet/wiki
      I can probably achieve this with RepeaterMatrix and by creating a specific Images field (and images template) but outside of that ?
      Thanks
    • By Andi
      Continuing my journey into PW hooks, I'm trying to find a way to retrieve all images from a page that explicitly *do not* have a certain tag (or tags) attached to them.
      Found this post from 2015
      But I'm wondering if there's a more elegant way to go about this.
      Let's say I have a multi-image field called "images_header" and instead of
      $page->images_header->findTag('mytag'); I would like to do this:
      $page->images_header->excludeTag('mytag'); So I'd be able to do
      // find images that don't have the tag "mytag" $images = $page->images_header->excludeTag('mytag'); // check if there's any images if (count($images)>0) { // do something.. } Would this be possible by hooking into Pagefiles somehow?
      There's this bit in /wire/core/Pagefiles.php Line 626 that I'd basically just need to reverse (or at least in my mind 😄 )
      public function findTag($tag) { $items = $this->makeNew(); foreach($this as $pagefile) { if($pagefile->hasTag($tag)) $items->add($pagefile); } return $items; } Any ideas on how this could be done in a graceful manner?
      Thanks in advance!
×
×
  • Create New...