We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39929
    • 113 Posts
    I'm using revo 2.2.11.
    From phpThumbof to pThumb.

    My concern now is the speed of my website and using some online tools, I found out that images in my nivo slider consume so much time in redering my page.

    Here is In my gallery output. and I found out
    [11-Feb-2014 08:20:37] PHP Warning:  
    file_get_contents(/xxxx/xxxxx/public_html/xxx/assets/components/gallery/cache/_xxx_xxxx_
    public_html_xxx_.3f2a6591ef3a3e72b1cd304653f331e1.jpeg) 
    [<a href='function.file-get-contents'>function.file-get-contents</a>]:
    failed to open stream: No such file or directory in 
    /home/xxxx/public_html/xxx/core/components/gallery/processors/web/phpthumb.php on 
    line 150
    



    then I look at the static folder in modx cache (assets->components->gallery->cache)
    and I found an underscore added in the name of my image name.

    _home_xxx_public_html_xxx_assets__gallery_3_197.jpg.3f2a6591ef3a3e72b1cd304653f331e1  
    


    I deleted already the original name, I'm not sure of the code above. I thought renaming it would help.
    but I'm sure about the underscore.
    Anyhelp will do. thank you.

    here is my website
    [url]assumptiondavao.edu.ph[url]

    [ed. note: claro_santiago last edited this post 12 years, 7 months ago.]
      • 44234
      • 219 Posts
      Hard to tell what the issue is without more info. Are you asking how to use 'Gallery' with 'pThumb' instead of 'phpThumbof'?

      Can you post your gallery call and tpl?
        Find me on Twitter, GitHub or Google+
        • 39929
        • 113 Posts
        I migrated from phpThumbof to pThumb.
        I don't really know the causes why my nivo slider images is so slow. I don't know if the problem is gallery or the pThumb.
        It really consumes so much time in showing my home page.

        The error log I posted is from gallery error logs. Perhaps I can start there in solving the problem.
        This is my website.
        assumptiondavao.edu.ph

        THank you for your response.
          • 42822
          • 21 Posts
          What do you mean by "slow"?
          For me it took 1.5s in average to get your page from server.

          Try to reduce the number of html-requests (a nice article: http://webdesign.about.com/od/speed/qt/minimize-http-requests.htm)
            • 39929
            • 113 Posts
            Really? But I'm sure my website will improve if I fix those images.
            Mr.Google told me in hist web page test, to leverage browser caching.
              • 42822
              • 21 Posts
              As David Pede requested:
              can you post your snippet call and tpl?
                • 39929
                • 113 Posts
                Mychunks.
                NivoGallery
                <div class="slider-wrapper [[!If? &subject=`[[*nivoTheme]]` 
                                                  &operand=`[[$nivoDefaultCss]]` 
                                                  &then=`theme-default`]]
                                           [[!If? &subject=`[[*nivoTheme]]` 
                                                  &operand=`[[$nivoOrmanCss]]` 
                                                  &then=`theme-orman`]]
                                           [[!If? &subject=`[[*nivoTheme]]` 
                                                  &operand=`[[$nivoPascalCss]]` 
                                                  &then=`theme-pascal`]]
                                           [[!If? &subject=`[[*nivoTheme]]` 
                                                  &operand=`[[$nivoStylePackCss]]` 
                                                  &then=`theme-style-pack`]]">
                    <div class="ribbon"></div>
                    <div id="slider" class="nivoSlider"  
                                     style="width:[[*nivoImageWidth]]px;
                                            height:[[*nivoImageHeight]]px;
                                            margin:0px auto;">   
                
                [[!Gallery? &album=`[[*nivoAlbum]]` 
                            &thumbTpl=`nivoRowTpl` 
                            &thumbWidth=`[[*nivoImageWidth]]` 
                            &thumbHeight=`[[*nivoImageHeight]]` 
                            &thumbProperties=`{"iar":"1"}` 
                            &thumbZoomCrop=`0`]]
                </div>
                </div>
                <div id="htmlcaption" class="nivo-html-caption"></div>
                


                NivoRowTpl
                [[If? 
                   &subject=`[[+url]]`
                   &operator=`empty`
                   &then=
                   `<img src="[[+thumbnail]]" alt="[[+name]]" title="[[+description]]" 
                              style="width:[[*nivoImageWidth]]px;
                                     height:[[*nivoImageHeight]]px;" />`
                   &else=
                   `<a href="[[+url]]" >
                    <img src="[[+thumbnail]]" alt="[[+name]]" title="[[+description]]" 
                              style="width:  [[*nivoImageWidth]]px;
                                     height: [[*nivoImageHeight]]px;" /></a>`]]
                


                NivoScrips
                 <script type="text/javascript">
                   
                    $(window).load(function() {
                      
                        $('#slider').nivoSlider({
                	  
                pauseTime:[[*nivoTimer]],
                effect:'[[*nivoEffect]]',
                controlNav:[[*nivoControlNav]],
                [[*nivoCaption]]});
                      var arrowHeight = $(".nivo-prevNav").height();
                      var sliderHeight = $("#slider").height();
                      var arrowPos = (sliderHeight/2)-(arrowHeight/2);
                      var sliderWidth = $("#slider").width();
                      var nivoImages = $(".nivo-controlNav").width();
                      var imageWidth = $("#slider img").width();
                      var imageHeight = $("#slider img").height();
                      var indicatorsPos = (sliderWidth/2)-(nivoImages/2);
                      $(".nivo-directionNav a").css({'top':arrowPos+"px"});
                      $(".nivo-controlNav").css({'left':indicatorsPos+"px"});
                      $(".nivoSlider img").css({'width':sliderWidth+"px",'height':sliderHeight+"px"});
                       });
                    </script>
                


                And this is how I call them in my home template.
                <head>
                <title>[[++site_name]] - [[*pagetitle]]</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                [[$links]]
                [[*nivoTheme]]
                </head>
                <body>
                <div id = 'wrapper'>
                [[$header]]
                [[*nivoGallery]]
                [[$nivoScripts]]
                
                [ed. note: claro_santiago last edited this post 12 years, 7 months ago.]
                  • 35150 ☆ A M B ☆
                  • 191 Posts
                  Quote from: claro_santiago at Feb 12, 2014, 06:16 PM
                  I migrated from phpThumbof to pThumb.
                  I don't really know the causes why my nivo slider images is so slow. I don't know if the problem is gallery or the pThumb.

                  The Gallery extra uses its own version of phpThumbOf, very similar to 1.4.0. Even if you have pThumb installed, you won't see any speed improvement with Gallery since Gallery isn't using it.

                  A couple suggestions:

                  1. In System Settings > core > phpThumb, set the three phpThumb Max Cache settings to 0. This will stop Gallery's phpThumbOf from wasting too much time trying to clean its cache on every image. If you have a lot of cached thumbnails, this should make a noticeable improvement.
                  2. Try to reduce the number of uncached snippets ( [[!...]] ) in your chunks. If you need the slider images to change often, use something like getCache with a separate cache partition and have it update every couple hours or whatever. As it is, those uncached snippets have to be run every time somebody hits your page.
                    Extras :: pThumb • Resizer • imageSlim • setPlaceholders
                    • 39929
                    • 113 Posts
                    Thank you for your response. I set already phpThumb Max Cache settings to 0, and remove [[!..]] in my snippets
                    ( but wait, is snippet [[!If?]] included?).

                    can you help me about this.

                    use something like getCache with a separate cache partition and have it update every couple hours or whatever. As it is, those uncached snippets have to be run every time somebody hits your page.



                    another thing, can I consider this thing a problem?
                    http://assumptiondavao.edu.ph/acd/assets/components/gallery/connector.php?action=web/phpthumb&w=776&h=324&zc=0&far=C&q=90&iar=1&src=%2Facd%2Fassets%2Fgallery%2F3%2F196.jpg
                    


                    And can it be solved by fixing my header? how?
                    Server: nginx/1.4.5
                    Date: Thu, 13 Feb 2014 02:46:41 GMT
                    Content-Type: text/html; charset=UTF-8
                    Content-Length: 5427
                    Connection: keep-alive
                    Expires: Thu, 19 Nov 1981 08:52:00 GMT
                    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
                    Pragma: no-cache
                    Vary: Accept-Encoding
                    Content-Encoding: gzip
                    
                      • 44234
                      • 219 Posts
                      If you want to use pThumb with gallery then you need to change the following:

                      Gallery Call:
                      [[Gallery?
                      &album=`[[*nivoAlbum]]`
                      &thumbTpl=`nivoRowTpl`]]
                      

                      nivoRowTpl:
                      [[If?
                         &subject=`[[+url]]`
                         &operator=`empty`
                         &then=
                         `<img src="[[+image_absolute:pthumb=`&w=[[*nivoImageWidth]]&h=[[*nivoImageHeight]]&zc=0&iar=1`]]" alt="[[+name]]" title="[[+description]]"
                                    style="width:[[*nivoImageWidth]]px;
                                           height:[[*nivoImageHeight]]px;" />`
                         &else=
                         `<a href="[[+url]]" >
                          <img src="[[+image_absolute:pthumb=`&w=[[*nivoImageWidth]]&h=[[*nivoImageHeight]]&zc=0&iar=1`]]" alt="[[+name]]" title="[[+description]]"
                                    style="width:  [[*nivoImageWidth]]px;
                                           height: [[*nivoImageHeight]]px;" /></a>`]]
                      

                      I would also recommend using the bundled snippet 'resizer' instead of 'phpThumb'. Change the pthumb setting 'phpthumbof.use_resizer' to 'Yes'. Resizer is bundled with 'pthumb' but double check it is installed!

                      another thing, can I consider this thing a problem?
                      http://assumptiondavao.edu.ph/acd/assets/components/gallery/connector.php?action=web/phpthumb&w=776&h=324&zc=0&far=C&q=90&iar=1&src=%2Facd%2Fassets%2Fgallery%2F3%2F196.jpg
                      If you mean make your urls more seo friendly and stop using the 'connector.php' then change the pthumb setting 'pthumb.use_ptcache' to 'Yes'.

                      If speed really is your priority then you should try and cut down on the 'if' calls as well. You have 4 just to set a div class and 1 in your tpl which will be executed for every image in your gallery. So if you had 10 images this would be 24 'if' calls on one page which is excessive.
                        Find me on Twitter, GitHub or Google+