We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18463
    • 121 Posts
    Martijn van Turnhout Reply #1, 12 years, 11 months ago
    I’ve just upgraded a website to MODX 2.1.1 PL. I’m using the latest version of Gallery, MODX itself (of course) and phpThumbOf. Though that last one doesn’t seem to be the problem, because I’m using that output filter on other pages and it works fine there. Also, thumbnails and images appear properly inside the filemanager and an Image TV.

    Anyways, I’m using several Gallery chunks on 1 page, outputting results with getResources:

    <h2>[[+pagetitle]]</h2>
    <p>[[+introtext]]</p>
    <ul class="album">
      [[!Gallery?
        &album=`[[+gallery_album]]`
        &thumbWidth=`150`
        &thumbHeight=`125`
        &useCss=`0`
      ]]      
    </ul>
    


    This is the content of galItemThumb:

    <li><a href="[[+image]]" rel="lightbox-[[+album]]" title="[[+description]]"><img src="[[+thumbnail]]" width="150" height="125" alt=""></a></li>
    


    However, after the upgrade from 2.1RC4 to 2.1.1 PL, the phpThumb function of both the thumbnail and larger images seems to have stopped working! No images are visible anymore and when I click on one of those phpThumb generated links, I’m getting this message:

    {"success":false,"message":"Access denied.","total":0,"data":[],"object":[]}
    


    So I’ve checked the Gallery component and its Gallery TV: there are no thumbnails/images visible anymore! New images that are uploaded to the Gallery component are blank as well. Again, this only happened after the upgrade from 2.1RC4 tot 2.1.1 PL. Perhaps the phpThumb function of Gallery hasn’t been upgraded to 2.1.1 PL yet? Just guessing here. I could use all the help I can get. Thanks!

    More info can be found here: https://github.com/splittingred/Gallery/issues/102
      • 28948
      • 42 Posts
      I get exactly the same behaviour — the path to the image gives me:

      {"success":false,"message":"Access denied.","total":0,"data":[],"object":[]}

        --
        cal wilson
        oksushi.com
        • 12491
        • 90 Posts
        Same here, in backend en frontend images are gone,
        in the filesystem they are there.



          Sommige mensen hebben aan een half woord genoeg
          • 28215
          • 4,149 Posts
          This has been fixed in Gallery 1.2.0-rc2.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 18463
            • 121 Posts
            Martijn van Turnhout Reply #5, 12 years, 11 months ago
            Posting it here again just to be sure wink.

            The RC2 fix only works when you’re loggedin. When you’re logged out: blank.

            Shaun, thanks in advance for all these quick fixes!
              • 17173
              • 0 Posts
              yep, same behavior here wink
                • 28215
                • 4,149 Posts
                See this commit for a quick fix:

                https://github.com/splittingred/Gallery/commit/da11219d32e10b2d303b3c99a359b483dff23d7e

                I’ll have another update out later today that fixes this and a few other issues (such as batch zip uploading, etc).
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 18463
                  • 121 Posts
                  Martijn van Turnhout Reply #8, 12 years, 11 months ago
                  Many thanks for all these updates, Shaun. I think I’m not the only one when I say Gallery really feels complete now smiley
                    • 40045
                    • 534 Posts
                    I still have issues with revo 2.1.1pl and gallery 1.2.1pl, posted about them here:

                    I think my problem is based on the gallery.files_path/url which I have set outside of assets/components/gallery/files/ (I want to have my images in another place, where the other media stuff resides...), when I get a thumb/image path in the frontend and enter it in the browser address bar I get the following:

                    [2011-06-23 15:56:50] (ERROR @ /assets/components/gallery/connector.php) [phpThumbOf] Could not generate thumbnail: /home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg - Debug: Array
                    (
                        [0] => phpThumb() v1.7.9-200712090829 in file "phpthumb.class.php" on line 216
                        [1] => setCacheDirectory() starting with config_cache_directory = "/home/account/public_html/client/core/cache/phpthumb/" in file "phpthumb.class.php" on line 919
                        [2] => setting config_cache_directory to realpath(/home/account/public_html/client/core/cache/phpthumb) = "/home/account/public_html/client/core/cache/phpthumb" in file "phpthumb.class.php" on line 947
                        [3] => ResolveFilenameToAbsolute() prepending $this->config_document_root (/home/account/public_html/client) to $filename (/assets/site/media/media.gallery/7/96.jpg) resulting in ($AbsoluteFilename = "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg") in file "phpthumb.class.php" on line 1025
                        [4] => setSourceFilename(/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg) set $this->sourceFilename to "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg" in file "phpthumb.class.php" on line 243
                        [5] => setCacheDirectory() starting with config_cache_directory = "/home/account/public_html/client/assets/components/gallery/cache/" in file "phpthumb.class.php" on line 919
                        [6] => setting config_cache_directory to realpath(/home/account/public_html/client/assets/components/gallery/cache) = "/home/account/public_html/client/assets/components/gallery/cache" in file "phpthumb.class.php" on line 947
                        [7] => setSourceFilename(/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg) set $this->sourceFilename to "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg" in file "phpthumb.class.php" on line 243
                        [8] => skipping CleanUpCacheDirectory() set to purge (30.0 days; 100.00MB; 10,000 files) in file "phpthumb.class.php" on line 652
                        [9] =>   file_exists() = 0 in file "phpthumb.class.php" on line 1101
                        [10] => is_executable() = 0 in file "phpthumb.class.php" on line 1102
                        [11] => using ImageMagick path from `which convert` (/usr/bin/convert) in file "phpthumb.class.php" on line 1121
                        [12] => ImageMagick version checked with "convert --version" in file "phpthumb.class.php" on line 1148
                        [13] => ImageMagick did not return recognized version string (Version: ImageMagick 6.4.8 2011-06-17 Q16 OpenMP http://www.imagemagick.org
                    Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC) in file "phpthumb.class.php" on line 1154
                        [14] => ImageMagick convert --version says "Unknown" in file "phpthumb.class.php" on line 1157
                        [15] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 884
                        [16] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 895
                        [17] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 902
                        [18] => $this->thumbnailQuality set to "85" in file "phpthumb.class.php" on line 912
                        [19] => ResolveFilenameToAbsolute() NOT prepending $this->config_document_root () to $filename (/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg) resulting in ($AbsoluteFilename = "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg") in file "phpthumb.class.php" on line 1022
                        [20] => !$this->config_allow_src_above_docroot therefore setting "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg" (outside "/home/account/public_html/client/assets/components/gallery") to null in file "phpthumb.class.php" on line 1066
                        [21] => $this->sourceFilename set to "" in file "phpthumb.class.php" on line 813
                        [22] => phpThumb() v1.7.9-200712090829
                    
                    "" does not exist in file "phpthumb.class.php" on line 3647
                        [23] => setCacheDirectory() starting with config_cache_directory = "/home/account/public_html/client/assets/components/gallery/cache" in file "phpthumb.class.php" on line 919
                        [24] => setting config_cache_directory to realpath(/home/account/public_html/client/assets/components/gallery/cache) = "/home/account/public_html/client/assets/components/gallery/cache" in file "phpthumb.class.php" on line 947
                        [25] => ResolveFilenameToAbsolute() NOT prepending $this->config_document_root () to $filename (/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg) resulting in ($AbsoluteFilename = "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg") in file "phpthumb.class.php" on line 1022
                        [26] => !$this->config_allow_src_above_docroot therefore setting "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg" (outside "/home/account/public_html/client/assets/components/gallery") to null in file "phpthumb.class.php" on line 1066
                        [27] => SetCacheFilename() _src set from md5($this->sourceFilename) "" = "d41d8cd98f00b204e9800998ecf8427e" in file "phpthumb.class.php" on line 3077
                        [28] => SetCacheFilename() _par set from md5(_farC_zc1_h130_w130_dpi150_q85) in file "phpthumb.class.php" on line 3110
                        [29] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2897
                        [30] => GetImageSize("") failed in file "phpthumb.class.php" on line 2920
                        [31] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1232
                        [32] => ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty in file "phpthumb.class.php" on line 1279
                        [33] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 2927
                        [34] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 2876
                        [35] => SetOrientationDependantWidthHeight() setting w="130", h="130" in file "phpthumb.class.php" on line 2892
                        [36] => EXIF thumbnail extraction: (size=0; type=""; 0x0) in file "phpthumb.class.php" on line 2979
                        [37] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3229
                        [38] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1232
                        [39] => ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty in file "phpthumb.class.php" on line 1279
                        [40] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3278
                        [41] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3330
                        [42] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3332
                        [43] => phpThumb() v1.7.9-200712090829
                    
                    Unknown image type identified by "" () in SourceImageToGD()[3444] in file "phpthumb.class.php" on line 3647
                        [44] => SourceImageToGD() failed in file "phpthumb.class.php" on line 323
                    )


                    as far as I understand this errorlog, the problem lies in step 20

                    [20] => !$this->config_allow_src_above_docroot therefore setting "/home/account/public_html/client/assets/site/media/media.gallery/7/96.jpg" (outside "/home/account/public_html/client/assets/components/gallery") to null in file "phpthumb.class.php" on line 1066


                    Because of that I have set the system setting "phpthumb_allow_src_above_docroot" under core > phpthumb to "Yes" instead of "No" but when I do that I instantly recieve a 503 error when editing a gallery in the backend or want to view it in the frontend...some thumbnails are loaded but not all and they seem to be generated very slowly (several minutes for under 10 images)

                    so I tried to comment out the critical section in phpthumb.class.php beginning @line 1066:

                    if (!$this->config_allow_src_above_docroot && !preg_match('#^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', realpath($this->config_document_root))).'#', $AbsoluteFilename)) {
                    			$this->DebugMessage('!$this->config_allow_src_above_docroot therefore setting "'.$AbsoluteFilename.'" (outside "'.realpath($this->config_document_root).'") to null', __FILE__, __LINE__);
                    			return false;
                    		}
                    


                    but when I do this, thumbnails are still loaded only partwise and painfully slow in the frontend. In the backend, I don’t see any galleries anymore when clicking on the components > gallery menuitem...so I can’t do this...

                    I really don’t know from which direction I have to address this problem...is it a problem of phpthumb, modx system settings, server hard-/software or the gallery snippet?

                    EDIT: Because of this thread: http://modxcms.com/forums/index.php/topic,65706.0.html I also checked my Filemanager to see if the thumbs work there...they do but also are generated very slowly...this was never a problem in the versions before...what can be the reason for this?