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

    I am trying to get phpthumbsup to work, but a having troubles.
    I think I am missing something obvious.

    My URL to the full-size image is a TV, and in my snippet I have this as a variable: $image
    This makes this image-tag on the page:
    <img src="assets/gallery/23.jpg">

    To get the thumbnail I then add this code:

    $imagethumb = '/phpthumbsup/w/120/h/120/zc/1/src/' . $image;

    But nothing happens. The page is now rendered with the image having this tag:

    <img src="/phpthumbsup/w/120/h/120/zc/1/src/assets/gallery/23.jpg">

    But nothing is shown on the page!

    What is wrong?

    All the best

    This question has been answered by sottwell. See the first response.

      • 44195
      • 293 Posts
      Sorry I haven't used phpthumbsup before but does it still occur if linking directly to an image? (as opposed to an image in a TV)
        I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
        Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
        • 49680
        • 19 Posts
        It is the same on a direct link: nothing happens.

          • 44195
          • 293 Posts
          Is the reason you're using phpthumbsup because you want to create permanent thumbnail files on upload?

          If not, could you possibly use pthumb instead? What exactly are you trying to do?


          Found a post from me about a year ago struggling with a similar thing. I ended up just using phpthumb directly in the core but that was for the backend so there may be permission issues if you're trying to do it for the front end.
          https://forums.modx.com/thread/89740/phpthumbsup---can-i-use-this-to-create-a-thumbnail-on-image-upload-through-my-custom-component
            I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
            Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
            • 29597 ☆ A M B ☆
            • 350 Posts
            I would use pThumb it is better now I think...

            I use it like this for responsive images (with picturefill):

            <img srcset=" 
            [[pthumb? &input=`[[*img]]` &options=`w=1336` &useResizer=`1`]] 1336w, 
            [[pthumb? &input=`[[*img]]` &options=`w=688` &useResizer=`1`]] 688w
            " src="
            [[pthumb? &input=`[[*img]]` &options=`w=688` &useResizer=`1`]]
            " sizes="100%" alt="[[*img_alt]]" class="img_max_width_6col" />
            
              MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
              DESIGNfromWITHIN, MPThemes and Any Screen Size
              Follow me on Twitter | Read my blog | My code on GitHub
              • 49680
              • 19 Posts
              Hello again

              I have now uninstalled phpthumbsup, and installed pThumb instead.

              I am now trying this on a direct link:

              <img src="assets/images/myimage.jpg:phpthumbof=`w=120&h=120&zc=1`" alt="" />

              I have tried this both locally on my Mac running MAMP PRO, and on the web server, where the site eventually will be running.
              I just get the missing-image icon, and no thumbnail.

              Somebody asked, what I was trying to do:

              I have built a gallery based on the document in a fold in the document tree. Each document has a TV for the image.
              For the overview (the document, that is the folder) I need to show the images as thumbnails.
              I think it would be best with permanent thumbnails, but right now, I just want to get SOMETHING shown on the page.
              This is the only thing I am missing. Everything else works fine, with navigation, pagination and links to the individual images.

              All the best
                • 50421
                • 1 Posts
                Hello

                I am trying to get phpthumbsup to work, but a having troubles.
                I think I am missing something obvious.

                My URL to the full-size image is a TV, and in my snippet I have this as a variable: $image
                This makes this image-tag on the page:
                <img src="assets/gallery/23.jpg">

                To get the thumbnail I then add this code:

                $imagethumb = '/phpthumbsup/w/120/h/120/zc/1/src/' . $image;

                But nothing happens. The page is now rendered with the image having this tag:

                <img src="/phpthumbsup/w/120/h/120/zc/1/src/assets/gallery/23.jpg">

                But nothing is shown on the page!

                What is wrong?

                All the best
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  pthumb may work better for you. It's basically a drop-in replacement for phpthumbof, with several enhancements. https://github.com/oo12/phpThumbOf/blob/pThumb-dev/README.md

                  <img [[*imagetv:pthumb=`w=200&h=200`]] alt="test image">
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 49680
                    • 19 Posts
                    Hello Again

                    As I wrote previously, I have now uninstalled phpthumbsup, and installed pThumb.

                    I still don't get any images on my page.

                    To get things as simple, as possible, I am now working with a chunk with this code:

                    <img src="assets/images/image.jpg:pthumb=`w=120&h=120&zc=1`">

                    on the page I get the missing image icon.
                    If I remove ":pthumb=`w=120&h=120&zc=1`", the image is shown fine (but unscaled).

                    I am sure I am missing something obvious, but I can't figure it out.

                    All the best
                      • 1343 ☆ A M B ☆
                      • 2,213 Posts
                      You need to call pThumb as Susan posted above. It's not something you can add to the image url as you have done.
                        Patrick | Server Wrangler
                        About Me: Website | Tweets |  MODX Hosting