We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31504
    • 16 Posts
    victorjonsson Reply #1, 16 years ago
    Good day people.

    I can’t seem to get thumbnails working in the MODx browser. Also as an example, thumbnails appear broken when selecting an image in a Template variable.

    I think it’s got something to with phpthumb. Although I can’t seem to find much about this in these forums, from what I’ve found is that it might have something to do with the fact that there is a ~ in my URL. I personally have no idea.

    My development URL is like this: http://server.com/~site/

    In the error log (/core/cache/logs/error.log)
    (ERROR @ /~site/connectors/system/phpthumb.php) Error outputting thumbnail:
    OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557


    In the phpthumb FAQ:
    Q: I’m getting is this error message:
    Failed: RenderToFile(<filename>) failed because
    !is_resource($this->gdimg_output)
    A: You missed the call to GenerateThumbnail() before
    RenderToFile() or OutputThumbnail.
    See /demo/phpThumb.demo.object.php for an example.

    Sombody must have tackled this problem before?

    Any help appreciated
      Freelance Multimedia Designer
      MODx - Wordpress
      www.victorjonsson.dk
      • 1169
      • 312 Posts
      I have read other posts on ~ in URL was with gallery and phpthumb cannot find post do not remember outcome.
        DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
        • 28215
        • 4,149 Posts
        splittingred Reply #3, 16 years ago
        Do you have the ’gd’ extension installed in PHP?
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 31504
          • 16 Posts
          victorjonsson Reply #4, 16 years ago
          Yes GD is enabled.

          From phpinfo():
          GD Support enabled
          GD Version bundled (2.0.34 compatible)
            Freelance Multimedia Designer
            MODx - Wordpress
            www.victorjonsson.dk
            • 28215
            • 4,149 Posts
            splittingred Reply #5, 16 years ago
            What about ImageMagick?
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 31504
              • 16 Posts
              victorjonsson Reply #6, 16 years ago
              Nope, ImageMagick doesn’t seem to be installed/enabled.

              At least no reference to it in phpinfo
                Freelance Multimedia Designer
                MODx - Wordpress
                www.victorjonsson.dk
                • 28215
                • 4,149 Posts
                splittingred Reply #7, 16 years ago
                Try installing it.
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 31504
                  • 16 Posts
                  victorjonsson Reply #8, 16 years ago
                  It’s hosted on a shared hosting environment so I doubt I can make that happen. smiley

                  But I do have WAMP installed locally and a Ubuntu server.

                  So I’ll try installing MODx 2.0.2 on those and see if get any wiser and report back.
                    Freelance Multimedia Designer
                    MODx - Wordpress
                    www.victorjonsson.dk
                    • 31504
                    • 16 Posts
                    victorjonsson Reply #9, 16 years ago
                    I can confirm that the problem is when "~" is in the URL.

                    I’ve tested 3 separate installations on 3 different machines. All MODx 2.0.2-pl traditional setup.

                    (BTW, none of those installations have ImageMagick installed.)

                    Local WAMP installation works fine. There was no "~" in the URL.
                    Localhost info:

                    Windows NT ARES 6.1 build 7600 ((null)) i586
                    gd

                    GD Support enabled
                    GD Version bundled (2.0.34 compatible)
                    FreeType Support enabled
                    FreeType Linkage with freetype
                    FreeType Version 2.3.9
                    GIF Read Support enabled
                    GIF Create Support enabled
                    JPEG Support enabled
                    libJPEG Version 6b
                    PNG Support enabled
                    libPNG Version 1.2.37
                    WBMP Support enabled
                    XBM Support enabled

                    Does not work (broken thumbnails, errors in error.log) at the development URL that contains "~".

                    Shared hosting:

                    PHP Version 5.2.14
                    Linux 2.6.18 i686
                    gd

                    GD Support enabled
                    GD Version bundled (2.0.34 compatible)
                    FreeType Support enabled
                    FreeType Linkage with freetype
                    FreeType Version 2.2.1
                    GIF Read Support enabled
                    GIF Create Support enabled
                    JPG Support enabled
                    PNG Support enabled
                    WBMP Support enabled
                    XPM Support enabled
                    XBM Support enabled

                    On my Ubuntu server it works fine without "~". When I setup the user_dir module for apache and tried again with the URL http://ip/~testuser/ the thumbnails broke like on the shared hosting.

                    My Ubuntu server:

                    PHP Version 5.2.6-3ubuntu4.6
                    Linux webserver 2.6.28-11-server
                    gd

                    GD Support enabled
                    GD Version 2.0 or higher
                    FreeType Support enabled
                    FreeType Linkage with freetype
                    FreeType Version 2.3.9
                    T1Lib Support enabled
                    GIF Read Support enabled
                    GIF Create Support enabled
                    JPG Support enabled
                    PNG Support enabled
                    WBMP Support enabled

                    So I think it’s fair to say that phpthumb has problems with "~" in the URL.

                    This might not be such a huge issue, and might even be phpthumb’s dev’s problem. But I feel it’s at least a problem for me because my clients can’t see their uploaded image while the site is in development. It takes away from the otherwise great, polished MODx experience.
                      Freelance Multimedia Designer
                      MODx - Wordpress
                      www.victorjonsson.dk
                      • 31504
                      • 16 Posts
                      victorjonsson Reply #10, 16 years ago
                      UPDATE

                      I was testing the Gallery addon on the shared hosting server.

                      I created a album and uploaded a image and presto! working thumbnails for the images I’ve uploaded.

                      Still no thumbnails for other images in the MODx browser.

                      And I can see the new Gallery addon thumbnails in /core/cache/phpthumb/.

                      There seems to be a difference between how the Gallery addon handles images and the MODx browser and template variables.
                        Freelance Multimedia Designer
                        MODx - Wordpress
                        www.victorjonsson.dk