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 EyeDentify
      Hello Dear PW Gurus.

      Hope you fair well in these Corona Crisis times.

      Anyhow, i have a problem with a Cryptic error message that shows up when i am trying to Delete images out of a Images field.
      The Error message does say a little but it does not make sense to me why i can´t delete the images because of it.

      Is it some permission issue perhaps?

      I will attach screenshots of it and what i did prior to it.
      I am from sweden so ignore the funny words here and there.

      Hope you all can send me on the right track.
      i am running PW 3.0.139 on this install.

      Step1:

      Step 2: Select the images with the trashcan symbol

       
      Step 3: Cryptic Error message

      I am scratching my head on this one, have not seen this before.

      Thankfull for all help.
      /EyeDentify
    • By Guy Incognito
      This short script loops through some images from an XML feed and pushes new ones to an image field. It all works perfectly, except for some reason the last image (only) in the loop each time doesn't receive the image description... can everyone spot why? TIA! 🙂 
      foreach ($propertyImages as $img) { $fileName = trim($img[0]); if ( !empty($fileName) ) { $imgPath = '../property_data/'.$fileName; if(file_exists($imgPath) && !in_array(strtolower($fileName),$currentImages)) { $p->property_images->add($imgPath); $p->save(); $newImg = $p->property_images->last(); $newImg->description = $img[1]; $p->save(); } } }  
    • By Robin S
      Add Image URLs
      Allows images/files to be added to Image/File fields by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image and file fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
      https://modules.processwire.com/modules/add-image-urls/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: 
      a predefined folder in site/templates/ and/or a  page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully.
      UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference
      Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Read on for features and use cases.
      Features
      Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ?
      If you want to let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site (e.g. icons, but not limited to that).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Installation and setup instructions can be found on github.
      Here's how the input field looks like in the page editor:

      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance.
      Thanks to all who contributed their feedback and suggestions which made this module what it is now.
       
    • By rushy
      Hi. I've been using Processwire for a few years now and installed it on a few different shared hosting servers without issues, but I'm now running into an issue on a Fasthosts shared server that I've not seen before. The installation goes ok and I have a working default site profile but I am unable to complete any uploads of images. It just hangs at the progress spinner during the upload. I thought it might be a priviledge issue so have temporarily set the dir / file privs. as 777 / 666 just to test that but it made no difference. I have no errors in the wire log. In server error log I have:
      set_time_limit() has been disabled for security reasons in ....htdocs/wire/core/ImageSizerEngine.php on line 1035 and i note in the assets/file dir. where the image is being stored the date on the file being created has a year of 1970 and 0 length. If I leave the page this file disappears and nothing has been stored. 
      Does anyone know how I can enable set_time_limit if this is likely to be the problem? 
      Many thanks! Paul
×
×
  • Create New...