Esempio n. 1
0
 public function testDataReturnsOverwrittenDimensions()
 {
     $path = vfsStream::url('webroot/img/flower.png');
     $img = imagecreate(10, 5);
     $black = imagecolorallocate($img, 0, 0, 0);
     $this->createImage($img, $path);
     $image = new Image();
     $image->load($path);
     $image->data('width', 20);
     $image->data('height', 40);
     $this->assertSame(20, $image->data('width'));
     $this->assertSame(40, $image->data('height'));
 }
Esempio n. 2
0
<?php

// Autoloader
require_once __DIR__ . '/../tests/bootstrap.php';
// Script
use imageColor\models\Image;
$elephpant = new Image();
$elephpant->load(__DIR__ . '/php.jpg');
$elephpantColors = $elephpant->primaryColors();
$rubyShirt = new Image();
$rubyShirt->load(__DIR__ . '/ruby.jpg');
$rubyShirtColors = $rubyShirt->primaryColors();
print_r(array('ruby.jpg' => $rubyShirtColors, 'php.jpg' => $elephpantColors));