We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8548
    • 104 Posts
    Hi, this looks great... if i can make it work will be a very nice addon.
    I’ve tried the 1.6 and the 1.7 beta on evo 1.0.2 and I just can’t make it work.

    I have 2 image type TV’s, i’ve followed the "in file" instruction to the letter, verifyed everything 3 times and still can’t have nothing working...

    :(
    any idea on why it’s not working for me.

    Do i have to make some kind of code to managermanager?

    regards
      • 28514
      • 25 Posts
      Quote from: andchir at Aug 03, 2009, 12:19 AM

      Resizing images of Template Variables

      Thanks for the modification! But is it also possible to add a function that is something like the Crop-tool of photoshop. So that I can specify which part of the image I want to be cropped.

      http://img193.imageshack.us/img193/899/resizeimage.png
        • 6408
        • 58 Posts
        Quote from: blaize at Oct 09, 2009, 11:37 AM

        That is how i got it to work, but I’m not sure if it’s 100% correct usage ;-)
        so please do not consider it as genuine instructions.

        1. Copy easyphpthumbnail.class.php file to assetes/plugins/tvimageresizer.
        2. Create plugin TVimageResizer and copy content of txt file.
        3. In plugin edit mode/plugin configuration paste sth like this:
        &th_width=Max.width;int;150 &th_height=Max.height;int;110 &prefix=prefix;int;_t
        4. In plugin edit mode/system events tab - check both: OnDocFormRender, OnBeforeDocFormSave.
        5. Save - and now edit your document with a proper template/TV.

        This way I got what screen capture shows on plugin’s download page.

        I do not know how to use round corners, watermark.

        Thanks for making this post.

        I followed your instructions and got very close to the output I was hoping for.

        To get the whole thing working, first make sure you are using ’Evolution’. Download the Beta version (1.7) of the TVimageresizer pluging that is on the foot of Andchir’s post (about 2 posts up).

        Then do the following:

        1. Copy easyphpthumbnail.class.php file to assetes/plugins/tvimageresizer.
        2. Create plugin TVimageResizer and copy content of txt/php file.
        3. Toggle to the plugin configuration tab and paste this:
        &th_width=Width;int;150 &th_height=Height;int;110 &prefix=Prefix;string;t_ &rcorner=Corners percentage of clipping;int;0 &watermark=Watermark image path (png);string;0 &copyrighttext=Copyright text;string;0 &quality=Quality;int;85

        3.1 - Press the ’update parameter display’button and the fields (width, height, prefix, corners, watermark path, copyright text, and quality appear.

        3.2 - this is the important bit - the plugin renders these settings globally, ie. to every image you upload - you cant change the parameters on each image you upload, as I understand it. So, add your copyright info, image resizing, corner percentage here. Copyright info wont appear if it is left as 0 - chnage it to any other value and it will be added to the image.

        3.3 - if you leave image width and height parameter blank (set to 0), you have more flexibility in terms of resizing it - you CAN adjust the sizes on the resource editing page.

        4. Click system events tab and check both: OnDocFormRender, OnBeforeDocFormSave.
        4.1 Save the plugin
        5. Creat a templatevariable (TV) of your choice and make sure you set the input type to ’image’.
        5.1. Assign your template variable to the template you want to upload images to.
        6. Edit the page, and browse for an image that you want to resize. Upload the pic - change the image dimensions using the checkbox and the two boxes.
        7. Press SAVE.
        8. Now if you go back to the the image upload form, you should see two images - one is the original image, the other is a thumbnail image with the rounded corners and copyright info, etc. The thumbnail has a prefix on it (which is t_ by default).

        i hope this helps people who are a bit lost on how to do this. good luck!


        Dan
          • 4971
          • 964 Posts
          @dannyL

          I have followed all your instructions to the letter and nothing appears
          in my TVs, existing or new ones...

          I am using Evo 1.0.2 - are you using the same version?
          TIA

          EDIT: I read in the authors Russian blog that TIR works with Evo 1.0,
          and my server has full GD support...

          what can it be? could it be conflicting with ManagerManager or PHx? in 1.0.2?
            Website: www.mercologia.com
            MODX Revo Tutorials:  www.modxperience.com

            MODX Professional Partner
            • 6408
            • 58 Posts
            @Charliez:

            Sorry - other than the steps I posted above, Im not sure what else it would be. Im shooting in the dark a little with this as I am certainly no expert in Modx (yet!) - nor do I know any PHP, etc. I got it working on the latest version of Modx, with the BETA version of the snippet thats posted above in this particular thread.

            When you edit the page with the image template variables on it - do you get the resize boxes?

            Dan.
              • 4971
              • 964 Posts
              No, I don’t... I initially thought that I had a typo, misspelling or
              an upper case in lower... but I already doubled check and all seem
              to be OK...

              I will keep looking... are you using Evo 1.0.2?
                Website: www.mercologia.com
                MODX Revo Tutorials:  www.modxperience.com

                MODX Professional Partner
                • 4971
                • 964 Posts
                I found a couple of typos in 1.7_beta that made the plugin innoperable.

                var imgNames = [$tvs];
                
                window.onDomReady(function(){
                  for (var i=0;i<imgNames.length;i++){
                    var elem = $('tv' + imageNames[i]);
                    if(elem!=null){
                      var field1 = new Element('input',{type:'checkbox', name:'rsz[]', id:'rsz'+(i+1), value:imageNames[i]});
                      var label = new Element('label',{'for':'rsz'+(i+1)});
                      var field2 = new Element('input',{type:'text', size:'5', name:'rszwidth[]', value:$th_width, 'styles': {'width':'20px'}});
                      var field3 = new Element('input',{type:'text', size:'5', name:'rszheight[]', value:$th_height, 'styles': {'width':'20px'}});
                      elem.getParent().adopt(field1).adopt(label.appendText('resize')).adopt(field2).appendText('x','after').adopt(field3);
                    }
                  }
                });



                should be:
                var imageNames = [$tvs];
                
                window.onDomReady(function(){
                  for (var i=0;i<imageNames.length;i++){
                    var elem = $('tv' + imageNames[i]);
                    if(elem!=null){
                      var field1 = new Element('input',{type:'checkbox', name:'rsz[]', id:'rsz'+(i+1), value:imageNames[i]});
                      var label = new Element('label',{for:'rsz'+(i+1)});
                      var field2 = new Element('input',{type:'text', size:'5', name:'rszwidth[]', value:$th_width, 'styles': {'width':'20px'}});
                      var field3 = new Element('input',{type:'text', size:'5', name:'rszheight[]', value:$th_height, 'styles': {'width':'20px'}});
                      elem.getParent().adopt(field1).adopt(label.appendText('resize')).adopt(field2).appendText('x','after').adopt(field3);
                    }
                  }
                });


                in lines 1 & 4 of the above code imgNames should be imageNames

                and

                in line 8 ’for’: should be for:

                Hope these helps...
                  Website: www.mercologia.com
                  MODX Revo Tutorials:  www.modxperience.com

                  MODX Professional Partner
                  • 4971
                  • 964 Posts
                  Thanks a lot, will test it when I have some time...
                  great snippet...
                    Website: www.mercologia.com
                    MODX Revo Tutorials:  www.modxperience.com

                    MODX Professional Partner
                    • 8548
                    • 104 Posts
                    Hi, this plugin answers my need... but only if I can make it work.
                    I have Evo 1.0.2 and I’ve tried the 1.5, 1.6, 1.7 beta1 and v1.7 beta2
                    followed all the instructions I could find but still nothing si working sad

                    anyone as suggestions?
                      • 4971
                      • 964 Posts
                      I am using 1.0.2 and tvresizer 1.7 beta 1 and all
                      is working fine.

                      You have to change the three bugs/typos I mention a few
                      post back to make it work...
                        Website: www.mercologia.com
                        MODX Revo Tutorials:  www.modxperience.com

                        MODX Professional Partner