We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    Can anyone tell me how to resize an image in a TV and chunk?

    I tried Image+TV, and that totally f@#k3d up my site (lots of frightening 503s), so I'm staying away from that.

    I also tired phpthumbof, but couldn't get that to work. I tried the examples here http://rtfm.modx.com/display/ADDON/phpThumbOf and here http://www.belafontecode.com/image-manipulation-with-phpthumbof-in-modx-revolution/ with absolutely no luck.

    I tested hardcoding the resizing and that worked, but that's obviously not going to be suitable for template and tv.

    Thanks.



      Content Creator and Copywriter
      • 42130
      • 10 Posts
      What do you mean by in a TV and chunk? Is it refering to the same image in a specific TV on a certain resource? Or is it hard coded image you want to manipulate?
        • 18367
        • 834 Posts
        I have a TV for the image and a chunk template that is calling that tv which looks like this

        [[+tv.boximage]]


        I want to re-size any image that it calls to a set size.
          Content Creator and Copywriter
          • 42130
          • 10 Posts
          Is the output of your TV set to text when using Phpthumbof? Without doing that the image wont display or get processed.
            • 18367
            • 834 Posts
            Yes I set it to text and all I got was text ie the url of the image.
              Content Creator and Copywriter
              • 18367
              • 834 Posts
              Ok just did a complete uninstall removal and reinstall of phpthumb

              I'm getting the image now, but no resizing.

              Here's the call
              <img src="[[+tv.boximage:phpthumbof=`w=120&h=120`]]" />
                Content Creator and Copywriter
                • 42130
                • 10 Posts
                try this:

                [[!phpthumbof? &input=`[[+tv.boximage]]` &options=`w=120&h=120`]]
                  • 38878
                  • 255 Posts
                  There'an addon for this (though I have not tried it) that may also work:

                  http://modx.com/extras/package/phpthumbfilter
                    • 18367
                    • 834 Posts
                    Quote from: joshuam at Mar 03, 2013, 10:03 AM
                    try this:

                    [[!phpthumbof? &input=`[[+tv.boximage]]` &options=`w=120&h=120`]]

                    Josh,

                    that makes the image disappear.


                    Harvey,

                    that extra contains the following message
                    This snippet has been pulled down due to a vulnerability in phpThumb. Please do not use this.
                      Content Creator and Copywriter
                      • 18367
                      • 834 Posts
                      OK,

                      for now I've simply hard coded the width into the chunk template

                      IE:
                      <img src="[[+tv.boximage]]" width="300" />


                      It works and does what I want, so I'll use that until someone can tell me where I'm going wrong with phpthumbof
                        Content Creator and Copywriter