We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6059
    • 45 Posts
    Hy, i tried to use phpthumb / phpthumbof for my image thumbs but have no luck. I tried both

    <img src="[[*image:phpthumbof=`&w=120&h=150`]]" />
    
    <img src="[[*image:phpthumbof=`w=120&h=150`]]" />
    
    <img src="[[*image:phpthumb=`&w=120&h=150`]]" />


    but nothings shows the thumbnail. By using phpthumb i get the originalpicture. After using phpthumbof i see nothing because of wrong path from phpthumbof. My local url to my site and picture is "http://localhost/modx_demo/assets/images/Chrysanthemum.jpg" but the url to pic is "/modx_demo2/assets/components/phpthumbof/cache/C:/Workspace/modx_demo2/assets/components/phpthumbof/cache/assets_img_Chrysanthemum.jpg.9a8b01c8ba2f123ac32657557c3d61f9.png" (thats written in the img src from phpthumbof) and thats why the image not load. Can someone tell me what to do for using this thumbs? I am using modx Revolution 2.0.7-pl. Is there a site where i can show what parameters a possible for phpthumb / phpthumbof?
      • 6059
      • 45 Posts
      Is nobody here who has used phpthumb or phpthumb of? and can me tell how he do it? maybe my call is wrong. Some examples can be helpfull. Is there any docu out here for that function?
        • 36607 ☆ A M B ☆
        • 44 Posts
        Hi

        I use phpthumbof. I have set up my TV and call it in a chunk. My original jpeg image is 604px x 400px. Phpthumbof creates a thumbnail of this image, which I use on my front page. An example of code I am using in my chunk where the name of my TV is "tnArticlepageImage1":

        <a href="[[~[[+id]]]]"><img src="[[+tnArticlepageImage1:phpthumbof=`f=jpeg&q=95&w=275&h=270&zc=1`]]" alt="slider large image"></a>


        You were correct to use:

        <img src="[[*image:phpthumbof=`w=120&h=150`]]" />


        Have you set up your "image" TV as follows:

        Image Type: Image
        Output Type: Text

        Also, there seems to be a problem for some users with phpthumbof outputting an extended path that is incorrect. I had this problem and had to change the phpthumbof snippet. A bug has been filed with Github. Check out the last couple of posts here that may help: http://modxcms.com/forums/index.php/topic,59490.msg350443.html#msg350443
          • 6059
          • 45 Posts
          Hey thanks for the post, get it to run now. No idea why it runs with error in my test system and in my working system it runs fine. Maybe to much tested in the test system.

          One problem with the generated image, i have a wihte border on top and bottom of the new image, i original pic there is no border. Any Idea?

          Is there a list of parameters to use for phpthumb/phpthumbof?



          The White border in top and front was because of wrong w and h parameters. After only set w or h it runs fine. Found some parameters on the web and the only interesting for me is "sia" source Image name, but it runs not, get only the old names in cache after clear cache.
            • 36607 ☆ A M B ☆
            • 44 Posts
            Hi

            I’m pleased that you got it working.

            I posted a link to a list of phpthumbof parameters yesterday. You can find this link in the following post:

            http://modxcms.com/forums/index.php/topic,61787.msg350961.html#msg350961

            Matty
              • 6059
              • 45 Posts
              cool list thanks for it, but teh option "sia" is not working for me. Is there something i make wrong? i call it like ’&sia=myname’ but the files in cache have the same name as they has before i clean the cache and load the page again.
                • 25801
                • 6 Posts
                It seems like I’ve run into the exact same problem.

                I tried fixing the path to the phpthumb system file with no luck.
                I installed phpthumbof 1.1.0 on MODx Revolution 2.0.8-pl (traditional)

                This is the line I use in my template. It only returns back the image’s path. As specified in phpThumbOf Documentation, the output of my TV is set as "Text".

                [[*tv_image:phpthumbof=`W=370&h=138&zc=1`]]


                I’m currently using a temporary solution which is to call upon the core phpthumb script and pass on width & height vars.
                <img src="connectors/system/phpthumb.php?src=[[*tv_image]]&w=370&h=138&zc=1" />

                This works perfectly. Any drawbacks to that solution ?

                Any suggestions would be greatly appreciated !

                Cheers,
                rwt
                  • 22019
                  • 390 Posts
                  Hi rwt - may not be related but I couldn’t get phpthumbof to work until I _manually_ created the cache folder ’assets/components/phpthumbof/cache’ and made it writeable.
                    Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                    • 25801
                    • 6 Posts
                    Quote from: odeclas at Mar 15, 2011, 06:35 AM

                    Hi rwt - may not be related but I couldn’t get phpthumbof to work until I _manually_ created the cache folder ’assets/components/phpthumbof/cache’ and made it writeable.

                    Thanks for the answer, unfortunately this is not the cause of the problem as the directory exists and is writable.
                      • 14822
                      • 61 Posts
                      Quote from: rwt at Mar 15, 2011, 06:10 AM

                      It seems like I’ve run into the exact same problem.

                      I tried fixing the path to the phpthumb system file with no luck.
                      I installed phpthumbof 1.1.0 on MODx Revolution 2.0.8-pl (traditional)

                      This is the line I use in my template. It only returns back the image’s path. As specified in phpThumbOf Documentation, the output of my TV is set as "Text".

                      [[*tv_image:phpthumbof=`W=370&h=138&zc=1`]]


                      I’m currently using a temporary solution which is to call upon the core phpthumb script and pass on width & height vars.
                      <img src="connectors/system/phpthumb.php?src=[[*tv_image]]&w=370&h=138&zc=1" />

                      This works perfectly. Any drawbacks to that solution ?

                      Any suggestions would be greatly appreciated !

                      Cheers,
                      rwt

                      Hi rwt, i have the same issue with the phpThumbof, i read your post and also also used the core phpthumb but i have a problem sad, the image only show in the website when I’m logged in the manage and I unknow how solve this.