We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    {core_path}components/phpthumbsup/ & {core_path}components/phpthumbsup/cache/

    I think I am missing the cache directory, but need clarification of where exactly to put it. Pardon the basic question, but is {core_path} referring to the core directory?

    After installing phpThumbsUp, I see a js file located in assets/components/phpthumbsup

    In core directory I see core/components/phpthumbsup/docs and elements/ and lexicon/ and model/. Do I need to create the cache directory in this location? The core seems like an odd place to store images being called by a web page.
      • 19872
      • 1,078 Posts
      I setup phpThumbsUp. Yes for respsonsive. 480,1024,2000 initial options for screen size. File name of image file when pulled from iPhone and desktop is different than the original file name, but no image file seems to be saved anywhere. iPhone gets the same size version as the original (2000 x 1125) except that the version sent to the iphone has a new file name IMG_0707.jpg.

      chunk code is simply
      [[+image:phpthumbsup=`w=640&h=360&q=90`]]


      source code output from the desktop is:
      /phpthumbsup/w/640/h/360/q/90/src/<img src="assets/images/image01.jpg" alt="" />  


      phpThumbsUp seems to be just renaming the image file and then serving it to both iPhone and desktop at the same size.

      Do I need to write chunk code for each size to accommodate the system settings for the responsive threshhold? Why are there no images stored in a cache somewhere? Am I writing the chunk incorrectly?

      Can anyone provide feedback on how better to set this up? [ed. note: mmcgee last edited this post 11 years, 10 months ago.]
        • 19872
        • 1,078 Posts
        Have made several more tests, and even changed the chunk code to:
        [[phpthumbsup? &input=`[[+image]]` &options=`w=640&h=360`]]


        which yielded the same source code except for the image quality
        /phpthumbsup/w/640/h/360/src/<img src="assets/images/image01.jpg" alt="" />


        Still no love.

        phpThumbsUps thus far seems to be effective for changing the file name, but it does not appear to deliver a smaller size file to a mobile device.

        Am I missing something?

          • 4172
          • 5,888 Posts
          I think your issue is, you have 'image' as output-type, but it should be the default-output-type, if you want to use output-filters on the value.

          Then put the img-tag around it by yourself:

          <img src="[[+image:phpthumbsup=`w=640&h=360&q=90`]]" />
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 19872
            • 1,078 Posts
            Hi Bruno:
            Thank you for responding.

            I'm at my wits end. I've tried every configuration. Default output. Image output. Including the tag. Excluding the tag. Now I've turned of the slider thinking maybe some js was firing too soon and creating a simple, basic image tv and it actually is working less effectively... throwing some of the random path code on the page along with the image or the missing image icon—depending on how I have the html structured.

            Now I've been testing with a simple TV (no js slider). Still know luck.

            Question: what does this mean? {core_path}components/phpthumbsup/cache/
            Does this mean it starts at the core folder? Do I go inside core, then inside components then inside phpthumbsup and create a directory called cache? I've done this, but because I've tried everything, just want to make sure I'm putting it in the correct location.

            In Darkstars' docs they call [[*image:phpthumbsup=`w=100&h=100`]] a snippet. Maybe I need to create a new snippet and put [[*image:phpthumbsup=`w=100&h=100`]] in the snippet? I've been just putting [[*image:phpthumbsup=`w=100&h=100`]] right there in my template between div tags.
              • 19872
              • 1,078 Posts
              I have the image output set to "default"

              This is my chunk:
              <img src="[[*imageTv:phpthumbsup=`w=640&h=360`]]">


              This is the output
              <img src="/phpthumbsup/w/640/h/360/src/assets/images/image01.jpg">
                • 19872
                • 1,078 Posts
                This output looks like one entire path to the image file. It's close in that the image01.jpg is 2000 px wide and the source is taken from safari on a 27 inch display, so in fact, the image that should be delivered is the original file called image01.jpg

                That path would suggest that there is a file located in a folder in the root of my site called "phpthumbsup" yet the file image01.jpg that I selected in the TV in the resource comes from assets/images

                Maybe for phpthumbsup to work, all image must originate in a folder called phpthumbsup located in the root of the site?

                All very confusing.
                  • 19872
                  • 1,078 Posts
                  I give up.

                  I have found that phpthumbsup is capable of renaming a file from it's original name to something like IMG_0711.jpg but not resizing it.

                  The auto create setting does work. I created a folder, and put that path along with image size info into the System Setting for phpthumbsup.auto_create I uploaded and image to that directory and indeed, two files were generated and stored in core/cache/phpthumbsup, each with a file name like flowers.36754895387832....jpg

                  Essentially phpThumbs up can do two things that I can already do without a snippet.
                    • 19872
                    • 1,078 Posts
                    Basically instead of processing images while parsing the page, it immediately returns a special url and the image is not resized until that url is requested. Read more about phpThumbsUp here.

                    When is the URL requested? How do you code so that the URL is requested? Is this add-on only for thumbnails for galleries? Why would I need this for thumbnails. Thumbnails are small and do not need any type of adaptive filter.

                    I want iPhone to request a smaller version of a much bigger image. Start with 2000px wide for desktop but deliver a 480px version to iPhone. Am I trying to get phpThumbs up to do something it was not intended for?

                    Darkstar says:
                    automatically size user-uploaded images for mobile devices,

                    How to I then get that automatically sized image for mobile devices to actually be sent to the mobile device?