sprain / class.Images.php

A PHP class to handle image manipulation
28 stars 18 forks source link

Missing: Set coordinates for cropping #8

Closed creativecat closed 11 years ago

creativecat commented 11 years ago

Currently, when cropping a image, you always start at 0|0. Would be great if you could add the additional option to crop a different area. Something like:

public function resize(
    $max_width,
    $max_height,
    $method="fit",
    $cropAreaLeftRight="c",
    $cropAreaBottomTop="c",
    $jpgQuality=75,
    $dst_x=0,
    $dst_y=0
) {

You could also check if is_numeric($cropAreaLeftRight) and is_numeric($cropAreaBottomTop) and when they are both numeric use those values for positioning the cropping area.

sprain commented 11 years ago

Feel free to implement the change and make a pull request.

creativecat commented 11 years ago

I'm working on it ;-)

sprain commented 11 years ago

Closed due to #9