ZenphotoCMS Forum
function getCustomImage changed ? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: function getCustomImage changed ? (/thread-2208.html)



function getCustomImage changed ? - edasque - 2008-02-07

Has function getCustomImage($size, $width, $height, $cropw, $croph, $cropx, $cropy, $thumbStandin=false) changed any ?




function getCustomImage changed ? - edasque - 2008-02-07

I used to be able to get a nicely cropped long image with but this doesn't work well with portrait mode photos anymore which get resize too short with getCustomImage(1000, 620, 180, 620, 180, 300, 300).




function getCustomImage changed ? - edasque - 2008-02-07

an example is:http://www.frenchguys.com/gallery/zp-core/i.php?a=Portfolio+2007%2FRassain&i=Set07Enhancer3from_IMG_7282+%281%29.jpg&s=1000&w=620&h=180&cw=620&ch=180&cx=300&cy=300




function getCustomImage changed ? - sbillard - 2008-02-08

There is a bug in 1.1.4, fixed in the nightly build.




function getCustomImage changed ? - edasque - 2008-02-08

Really, should it be fixed in zenphoto-2008-02-07-trunk.zip ?




function getCustomImage changed ? - sbillard - 2008-02-09

Yes.




function getCustomImage changed ? - edasque - 2008-02-11

Hmmm, it seems not.

getCustomImage(1000, 610, 180, 610, 180, 100, 100

from an image that's creates an image that's 407px x 180px from an original that's 684px x 1024px. Its URL if it helps is:

http://localhost:8888/zenphoto/cache/Portfolio%202003/187C0530_faded.jpg_610_cw610_ch180_cx100_cy100.jpg




function getCustomImage changed ? - sbillard - 2008-02-11

You shouldn't be setting all the parameters.
from the i.php description of how these work:

  • s - size (logical): Based on config, makes an image of "size s."
  • h - height (explicit): Image is always h pixels high, w is calculated.
  • w - width (explicit): Image is always w pixels wide, h is calculated.
  • cw - crop width: crops the image to cw pixels wide.
  • ch - crop height: crops the image to ch pixels high.
  • cx - crop x position: the x (horizontal) position of the crop area.
  • cy - crop y position: the y (vertical) position of the crop area.
  • q - JPEG quality (1-100): sets the quality of the resulting image.
  • t - Set for custom images if used as thumbs (no watermarking.)
    • cx and cy are measured from the top-left corner of the scaled image.
    • One of s, h, or w must be specified; the others are optional.
    • If more than one of s, h, or w are specified, s takes priority, then w+h:
    • If both w and h are given, the image is resized to shortest side, then
  • cropped on the remaining dimension. Image output will always be WxH.
    • If none of s, h, or w are specified, the original image is returned.

here is how stopdesign handles portrait/landscape images:

`

      [b]



      [/b]




      `