We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27437
    • 49 Posts
    So I have this page: http://www.meubelrestauratie.nu/fotogalerij.html

    You see landscape pictures are rendering fine, and portrait pictures are out of the aspect ratio.

    This are the settings I used:
    &thumbProperties=`{
    	"zc":"0",
    	"w":"169",
    	"h":"169",
    	"f":"png",
    	"q":"80",
    	"far":"C"
    	}` 	
    


    Can anyone explain me why the portrait images are not rendering properly?
      • 42046
      • 436 Posts
      If you want them to all be 169x169, you'll have to set zc (zoom-crop) to 1 otherwise phpthumb will stretch the image if it doesn't fit the aspect ratio doesn't match the specified dimensions.
        • 27437
        • 49 Posts
        Hey thanks, but that is not what I want. I want the image to resize to max 169w or 169h, depending if it's portrait or landscape. So the aspect ratio remains but in a smaller picture, if that makes any sense.

        Actually the images are all square, the format is png so they have transparant sides, which make them look like normal resized pictures. The landscape pictures are as they supposed to work out, but the portrait pictures are stretched as you can see.

        So I'm wondering if pthumb can do this with build in functionality or should I write something myself?
          • 42046
          • 436 Posts
          So you want the largest side to be 169?

          Try using &hp=169 &wl=169 (height portrait, width landscape).

          Available parameters which might be useful are :

          . wp = max width for portrait images
          hp = max height for portrait images
          wl = max width for landscape images
          hl = max height for landscape images
          ws = max width for square images
          hs = max height for square images

          Full list at:
          http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt
            • 27437
            • 49 Posts
            Tried that, actually wl169 and hp169 gives the same result as w169 h169. [ed. note: sjeijk last edited this post 11 years, 11 months ago.]