Thumbor\Url\CommandSet::trim PHP Метод

trim() публичный Метод

For tolerance the euclidian distance between the colors of the reference pixel and the surrounding pixels is used. If the distance is within the tolerance they'll get trimmed. For a RGB image the tolerance would be within the range 0-442
public trim ( $colourSource = null, $tolerance = null )
    public function trim($colourSource = null, $tolerance = null)
    {
        $this->trim = 'trim';
        $this->trim .= $colourSource ? ":{$colourSource}" : '';
        $this->trim .= $tolerance ? ":{$tolerance}" : '';
    }

Usage Example

Пример #1
0
 public function testTrim()
 {
     $commandSet = new CommandSet();
     $commandSet->trim();
     $this->assertEquals(array('trim'), $commandSet->toArray());
     $commandSet->trim('bottom-right');
     $this->assertEquals(array('trim:bottom-right'), $commandSet->toArray());
 }