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).
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:
Comments
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 2003/187C0530_faded.jpg_610_cw610_ch180_cx100_cy100.jpg
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:
` <?php<br />
$ls = isLandscape();
if (!$ls) {
$s = getDefaultWidth();
$h = getDefaultHeight();
$r = 480/$h;
$s = round($r*$s)+22;
$wide = "style=\"width:".$s."px;\"";
} else {
$wide = '';
}
?>
<?php if ($show = !checkForPassword()) { ?>
<?php } ?>`<?php printCustomSizedImage(getImageTitle(), null, $ls?480:null, $ls?null:480); ?>