We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34078
    • 76 Posts
    Hi everyone,

    Here my problem.

    I have to display differents sizes of thumbnails into my gallery page through a custom snippet. For now I call phpthumbof to generate them but the first web page render can be very long and even causes crashes because of a lack of memory.

    Is there an elegant way (without hacking Gallery's core) to generate several thumbnails (for example one of 100x100 pixels and an other of 1024x768 pixels) once the file was uploaded ?

    It could be possible if there was a kind of "OnGalleryUploadFile" plugin but such a plugin doesn't exist.

    Any idea ? Did you already have the same problem ?

    Thanks
      • 34120
      • 236 Posts
      If i understand you correctly, you would want the thumbnails to be generated when you upload the images? I don't have a solution unfortunately but would like to know if this is possible also. This would be a really handy feature to do all the heavy processing at the upload stage.

      Regarding phpthumbof the first load could take a huge amount of time but after this the thumbs should be cached. As temporary fix you could try increasing the php memory limit with a php.ini file.
        • 34078
        • 76 Posts
        Yes, you understood me ! wink

        Indeed, phpthumbof thumbnails are cached, so only the first load takes a huge amount of time but sometimes this takes so much time (and memory) that PHP renders a blank page.

        Besides, at last, the website will be hosted on a shared host so I can't increase php memory limit.

        I posted a ticket on Gallery github : https://github.com/splittingred/Gallery/issues/222

        Wait and see
          • 34120
          • 236 Posts
          Hi Ben, good work on posting the ticket, I look forward to a response.

          I have been able to set php.ini settings on my shared hosting, I only discovered this recently. I'm able to upload a php.ini file with the required settings to the relevant directory. I guess this will vary for different hosts, in my case I had to name the file .user.ini. Might be worth a look as a temporary workaround.
            • 34078
            • 76 Posts
            I also can edit some PHP settings in php.ini (on 1&1) but unfortunatly not the memory limit. sad
              • 34120
              • 236 Posts
              Back to the original post, I wonder if something could be done with OnFileManagerUpload?
                • 34078
                • 76 Posts
                @bobwal I tried, but Gallery doesn't trigger OnFileManagerUpload event. Thanks anyway.