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

    There seems to be a bug in the caching system for the thumbnails as well as for the pictures. I checked it on two modx-installations on different servers/hosters, always with negative results:

    Thumbnails and "big" images are created as intended in /core/cache/phpthumb, but they are newer used, instead gallery/phpthumb will create new ones every time the page is loaded. This leads to big problems:

    1. The cache-directory grows and grows quickly until you reach your quota.
    2. galleries take ages to be displayed
    3. some pictures or thumbnails are missing on the page because of cpu quotas.

    For testing purposes I sticked to the examples in rtfm.modxcms.com. Cached images were created in /core/cache/phpthumb with names such as:
    phpThumb_cache_www.example.com_src02cf467c172dff1f08537983170af1df_par39d5745543a22887a16d2b7186becc99_dat0.jpeg
    (I changed the domain-part of the filename).
    I got no errors in the error log. Imagemagick should work, otherwise there would be no scaled images in the cache dir. Also file and dir permissions look ok. The cached images look ok as well. I have no other clue than to suspect a bug.

    There are many messages here in the forum complaining about missing images, I would guess, some of these could be related to this problem.

    Any ideas how to fix this? This problem prevents me from lauching a new website for a customer, so any help would be appreciated.

    Jörg

    (Modx Revo 2.0.4pl2, MySQL 5.0.37-max-log, PHP 5.2.10)
      • 7806
      • 45 Posts
      Followup to my own post:

      I tried to re-install gallery on my Revo installation. Now I get no thumbnails or pictures at all anymore, but messages like these:

      [2010-10-28 23:49:16] (ERROR @ /assets/components/gallery/connector.php) [Gallery] Error outputting thumbnail:
      OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557
      [2010-10-28 23:49:16] (ERROR @ /assets/components/gallery/connector.php) [Gallery] Error outputting thumbnail:
      OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557
      [2010-10-28 23:49:16] (ERROR @ /assets/components/gallery/connector.php) [Gallery] phpThumb was unable to generate a thumbnail for: /homepages/19/d101320974/htdocs/2010-08_modx2/core/cache/phpthumb/phpThumb_cache_test1008.EXAMPLE.de_src40e6e290045882c112105651613423f5_par39d5745543a22887a16d2b7186becc99_dat0.jpeg
      [2010-10-28 23:49:16] (ERROR @ /assets/components/gallery/connector.php) [Gallery] Error outputting thumbnail:
      OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557
      [2010-10-28 23:49:17] (ERROR @ /assets/components/gallery/connector.php) [Gallery] phpThumb was unable to generate a thumbnail for: /homepages/19/d101320974/htdocs/2010-08_modx2/core/cache/phpthumb/phpThumb_cache_test1008.EXAMPLE.de_srce03f7181f29220a05723a1aaf38d3478_par39d5745543a22887a16d2b7186becc99_dat0.jpeg
      


      Sigh. I’m giving up. I’m going back to Evo and start from scratch. The website has to be ready, soon.

      I’m looking forward to using Revo on future projects when all the gallery issues are solved.

      Jörg
        • 10638
        • 57 Posts
        I appear to be having the same problem. It is particularly evident when using the gallery component with the nivo slider jquery plugin.

        http://staging.trimbuild.com.au/projects/project-02.html

        I wonder if there is a way to grab the cached version instead of rendering the image every single time? huh
          • 10638
          • 57 Posts
          I am having the same problem on another revo site (2.0.4pl-2). In fact all 3 revo sites I have built using the gallery package are having this problem.
            • 16337
            • 44 Posts
            Revo 2.0.7 and Gallery 1.0.2 rc2
            still having same issues. can’t figure it out...

            hmm
              • 13373
              • 70 Posts
              Has anyone sorted out why the phpThumb cache isn’t being used??

              My gallery reloads each thumb every time, which doesn’t seem right.

              I’m using Revo 2.0.8 with Gallery 1.0.2.

              Cheers
              Jacob
                • 7806
                • 45 Posts
                After some months of waiting, I checked into this bug again and it has not been fixed.

                I installed a fresh version of 2.0.8, installed gallery and uploaded some pictures. A gallery is created on the frontend. Everything works in principle, but again, all the thumbails are on-the-fly generated versions, not cached ones. That is a HUGE performance hit.

                I did find small automatically-generated thumbnails in /core/cache/phpthumb, but they are never re-used. So they are completely useless.

                When I try phpthumbof in comparison, everything works great, the thumbnails that are displayed indeed are files from the thumbnail-cache (in this case from /assets/components/phpthumbof/cache).

                What I also find strange is that gallery.phpthumb_path points to /core/components/phpthumb/ while phpthumb is located at core/model/phpthumb/. But changing it to the latter does not help.

                All in all I suspect there’s just a small misconfiguration but that makes the gallery almost unusable for more than just a handful of images. Would be great if the authors could look into it.

                D.

                  • 16337
                  • 44 Posts
                  I wonder if this is a phpthumb bug or gallery extra bug. or modx core bug?
                    • 7806
                    • 45 Posts
                    Quote from: krisj at Mar 05, 2011, 04:59 AM

                    I wonder if this is a phpthumb bug or gallery extra bug. or modx core bug?

                    I’d suspect gallery. phpThumbOf uses phpthumb and it works.

                    D.
                      • 34022 ☆ A M B ☆
                      • 91 Posts
                      As I mentioned in another post, I’ve been using phpthumbof directly in the Gallery templates to fix the problem. Works perfectly for me:
                      [[+fileurl:phpthumbof=`w=890&h=890`]]
                        WebsiteZen.com - MODX and E-Commerce web development in the San Francisco Bay Area