We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44298
    • 8 Posts
    Hello, profs!

    Im newbie of MODX.

    I moved Revo to localhost.
    So, now i have some problems in render method of phpThumbOf. Previews of any images don't load anywhere!

    I need help!

    Details;

    [2013-07-01 14:54:12] (ERROR @ /index.php) [phpThumbOf] Could not generate thumbnail: //public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg - Debug: Array
    (
        [0] => phpThumb() v1.7.9-200712090829 in file "phpthumb.class.php" on line 216
        [1] => setCacheDirectory() starting with config_cache_directory = "Z:/home/peffect.bz/www/core/cache/phpthumb/" in file "phpthumb.class.php" on line 919
        [2] => setting config_cache_directory to realpath(Z:\home\peffect.bz\www\core\cache\phpthumb) = "Z:\home\peffect.bz\www\core\cache\phpthumb" in file "phpthumb.class.php" on line 947
        [3] => setCacheDirectory() starting with config_cache_directory = "/home/peffect.bz/www/assets/components/phpthumbof/cache/" in file "phpthumb.class.php" on line 919
        [4] => setting config_cache_directory to realpath(\home\peffect.bz\www\assets\components\phpthumbof\cache) = "Z:\home\peffect.bz\www\assets\components\phpthumbof\cache" in file "phpthumb.class.php" on line 947
        [5] => setSourceFilename(//public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg) set $this->sourceFilename to "//public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg" in file "phpthumb.class.php" on line 243
        [6] => skipping CleanUpCacheDirectory() set to purge (30.0 days; 100.00MB; 10,000 files) in file "phpthumb.class.php" on line 652
        [7] =>   file_exists() = 0 in file "phpthumb.class.php" on line 1101
        [8] => is_executable() = 0 in file "phpthumb.class.php" on line 1102
        [9] => ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path (), and `which convert` returned () in file "phpthumb.class.php" on line 1131
        [10] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg) in file "phpthumb.class.php" on line 884
        [11] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 895
        [12] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 902
        [13] => $this->thumbnailQuality set to "99" in file "phpthumb.class.php" on line 912
        [14] => !$this->config_allow_src_above_docroot therefore setting "//public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg" (outside "Z:\home\peffect.bz\www") to null in file "phpthumb.class.php" on line 1066
        [15] => $this->sourceFilename set to "" in file "phpthumb.class.php" on line 813
        [16] => phpThumb() v1.7.9-200712090829
    
    "" does not exist in file "phpthumb.class.php" on line 3647
        [17] => setCacheDirectory() starting with config_cache_directory = "Z:\home\peffect.bz\www\assets\components\phpthumbof\cache" in file "phpthumb.class.php" on line 919
        [18] => setting config_cache_directory to realpath(Z:\home\peffect.bz\www\assets\components\phpthumbof\cache) = "Z:\home\peffect.bz\www\assets\components\phpthumbof\cache" in file "phpthumb.class.php" on line 947
        [19] => !$this->config_allow_src_above_docroot therefore setting "//public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg" (outside "Z:\home\peffect.bz\www") to null in file "phpthumb.class.php" on line 1066
        [20] => SetCacheFilename() _src set from md5($this->sourceFilename) "" = "d41d8cd98f00b204e9800998ecf8427e" in file "phpthumb.class.php" on line 3077
        [21] => SetCacheFilename() _par set from md5(_farC_h350_w350_dpi150_q99) in file "phpthumb.class.php" on line 3110
        [22] => starting ExtractEXIFgetImageSize() in file "phpthumb.class.php" on line 2897
        [23] => GetImageSize("") failed in file "phpthumb.class.php" on line 2920
        [24] => $this->useRawIMoutput=true after checking $UnAllowedParameters in file "phpthumb.class.php" on line 1232
        [25] => ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty in file "phpthumb.class.php" on line 1279
        [26] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 2927
        [27] => SetOrientationDependantWidthHeight() starting with ""x"" in file "phpthumb.class.php" on line 2876
        [28] => SetOrientationDependantWidthHeight() setting w="350", h="350" in file "phpthumb.class.php" on line 2892
        [29] => exif_thumbnail() does not exist, cannot extract EXIF thumbnail in file "phpthumb.class.php" on line 2974
        [30] => starting SourceImageToGD() in file "phpthumb.class.php" on line 3229
        [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] => Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty in file "phpthumb.class.php" on line 3278
        [34] => $this->gdimg_source is still empty in file "phpthumb.class.php" on line 3330
        [35] => ImageMagickThumbnailToGD() failed in file "phpthumb.class.php" on line 3332
        [36] => phpThumb() v1.7.9-200712090829
    
    Unknown image type identified by "" () in SourceImageToGD()[3444] in file "phpthumb.class.php" on line 3647
        [37] => SourceImageToGD() failed in file "phpthumb.class.php" on line 323
    )
    </strong>
    [ed. note: alexhappy last edited this post 13 years, 3 months ago.]
      • 35150 ☆ A M B ☆
      • 191 Posts
      First problem: it appears the constant DIRECTORY_SEPARATOR isn't set for your PHP installation. Create a snippet with these lines and see what it outputs:
      <?php
      return ' _ ' . DIRECTORY_SEPARATOR . ' _ ';
      

      On a unix machine that should return _ / _; on Windows I suppose it'd be _ \ _ . In your case I'm guessing it'll return _ _ (that is, nothing). That's what's causing config_cache_directory to get changed from Z:/home/peffect.bz/www/core/cache/phpthumb/ to Z:homepeffect.bzwwwcorecachephpthumb. I think this is the spot in the code where it's happening.

      Second problem: the image's filename is getting set to //public/product-images/Books_el_pk/kmr_el/kniga_mr_7.jpg. The leading double slash is wrong—that's probably getting added for you—but still it looks like the wrong path based on where you have MODX installed on your machine. What's your MODX_BASE_PATH set to? And what's the exact filename you're passing to phpThumbOf?

      You can check the base path with another little snippet:
      <?php
      return MODX_BASE_PATH;
      


      Or instead of making those snippets you can use this extra and execute PHP code directly from a window in the Manager.

      Also you don't have ImageMagick installed, or phpThumb isn't finding it. It'll work without it however, so that's not critical.
        Extras :: pThumb • Resizer • imageSlim • setPlaceholders
        • 44298
        • 8 Posts
        jgrant, Thank you for your reply.

        I executed all your php. Results:
        1. _ \ _
        2. MODX_BASE_PATH = /home/peffect.bz/www/

        I learned, there wasn't problem with
        ...from Z:/home/peffect.bz/www/core/cache/phpthumb/ to Z:homepeffect.bzwwwcorecachephpthumb...
        It was problem with copy/paste=)))) (Buffer from one site ate these syms). I corrected my post.

        But problem with two sladges really occurred. I used substr as a quick solution and it was successful.

        It wasn't my project, so I didn't learn, why 2 //.


        Thank you, once again)
          • 44298
          • 8 Posts
          But these 2 slashes appeared in another place!!!

          Migx use folder 'public' (just name) in root for uploading any files.
          And any previews generate by phpthumbof like this [[+ProductImage:phpthumbof=`w=160&h=160&zc=0&q=100`]]] , ProductImage parameter of ImageType by Migx
          I looked inside phpthumbof and learned that $input parameter already contains //public...., so please could you tell me where this place for set upload path or rules for separators is.
            • 44298
            • 8 Posts
            Probably i localized problem.

            It was used custom paths for media sources:




            Does anyone know why it worked on usual server (NOT localhost) server?

            tags: modx | revo | phpthumbof | migx | double slash | media sources
              • 35150 ☆ A M B ☆
              • 191 Posts
              Hmm, since basePathRelative and baseUrlRelative are both set to Yes, then basePath and baseUrl should be public/ and not /public/.

              Maybe it worked on the original server because its OS handles multiple slashes differently than Windows? Just a guess. I know in a bash shell at least you can do something like cd dir/////subdir and it'll interpret that as cd dir/subdir and not complain about it.
                Extras :: pThumb • Resizer • imageSlim • setPlaceholders