We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I have several sites that have started getting phpthumb errors when using this.renderImage to generate thumbnails in the list. The thumbnails are not generated in the back-end list although it works fine in the front-end.

    modx 2.2.4, Rackspace Cloud Sites, migx 2.3.1

    Using custom media source on the inputTV for the image pointing to filesystem assets/images/

    Here is the error:

    [2012-08-30 16:04:36] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: ...core/cache/phpthumb/generatedthumbnail.jpeg
    [2012-08-30 16:04:37] (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
    OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557

    [
    {"caption":"Gallery", "fields": [
        {"field":"image","caption":"Image","inputTV":"imageTV"}
    ]}
    ]


    [
    {"header": "Image", "width": "50", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"}
    ]


    I removed my paths and filenames from the error. Anyone else encountering this? Any ideas what is going on? Assistance is much appreciated! [ed. note: pyrographics last edited this post 11 years, 7 months ago.]
      • 4172
      • 5,888 Posts
      what is the path (output from getImageList) of a not working image?

      is the same image with the same output-path working with phpthumbof, when you try it outside of MIGX in a standalone image-TV for example?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • getImageList outputs: /assets/images/2012-auto-parts-gallery/100_2058.jpg

        phpThumbOf through getImageList outputs: /assets/components/phpthumbof/cache/100_2058.6f48a82beff109794692619590fda6592.jpg and it is working.

        generic image TV using the same media source outputs: /assets/images/2012-auto-parts-gallery/100_2058.jpg

        It is as if this.renderImage is getting the wrong path somewhere. I am not sure why all of these output paths are absolute, relative is checked in the media source.
          • 4172
          • 5,888 Posts
          ok, and what is the <img .......... > tag, rendered by this.renderImage in the grid?

          use firebug to get it.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
          • this.renderImage points to http://www.mywebaddress.com/connectors/system/phpthumb.php?h=60&src=2012-gallery-images/102_0525.jpg

            If I click to edit one of the items in the grid, the preview shows up. http://www.mywebaddress.com/connectors/system/phpthumb.php?h=150&w=150&src=2012-auto-parts-gallery/100_2058.jpg&source=2

            The difference is &source=2, without it the image doesn't display, with it the image displays.
              • 4172
              • 5,888 Posts
              this is a bug. Its only working, when configured by MIGX-configurator.
              There is a missing part.

              add this lines to https://github.com/Bruno17/MIGX/blob/master/core/components/migx/model/migx/migx.class.php#L720

              after line 719:

                      if (empty($formtabs))
                      {
                          // get them from input-properties
                          $formtabs = $this->modx->fromJSON($this->modx->getOption('formtabs', $properties, $default_formtabs));
                          $formtabs = empty($properties['formtabs']) ? $this->modx->fromJSON($default_formtabs) : $formtabs;
                      }
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
              • That fixes it. Thanks!