1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-05 07:37:37 +02:00

correcting test

This commit is contained in:
Mikael Roos
2015-10-26 21:09:32 +01:00
parent 0efcfd5bc7
commit f9a4205579
2 changed files with 12 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ class CImageSRGBTest extends \PHPUnit_Framework_TestCase
{ {
private $srgbDir = "srgb"; private $srgbDir = "srgb";
private $cache; private $cache;
private $srgbColorProfile = __DIR__ . '/../icc/sRGB_IEC61966-2-1_black_scaled.icc'; private $srgbColorProfile;
@@ -18,6 +18,7 @@ class CImageSRGBTest extends \PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->srgbColorProfile = __DIR__ . '/../icc/sRGB_IEC61966-2-1_black_scaled.icc';
$this->cache = CACHE_PATH . "/" . $this->srgbDir; $this->cache = CACHE_PATH . "/" . $this->srgbDir;
if (!is_writable($this->cache)) { if (!is_writable($this->cache)) {
@@ -44,7 +45,7 @@ class CImageSRGBTest extends \PHPUnit_Framework_TestCase
); );
if (class_exists("Imagick")) { if (class_exists("Imagick")) {
$this->assertEquals("car.png", basename($filename), "Filename not as expected on image."); $this->assertEquals("srgb_car.png", basename($filename), "Filename not as expected on image.");
} else { } else {
$this->assertFalse($filename, "ImageMagick not installed, silent fail"); $this->assertFalse($filename, "ImageMagick not installed, silent fail");
} }

View File

@@ -631,6 +631,12 @@ verbose("area = $area");
* skip-original, so - skip the original image and always process a new image * skip-original, so - skip the original image and always process a new image
*/ */
$useOriginal = getDefined(array('skip-original', 'so'), false, true); $useOriginal = getDefined(array('skip-original', 'so'), false, true);
$useOriginalDefault = getConfig('skip_original', false);
if ($useOriginalDefault === true) {
verbose("use original is default ON");
$useOriginal = true;
}
verbose("use original = $useOriginal"); verbose("use original = $useOriginal");
@@ -976,13 +982,13 @@ if ($dummyImage === true) {
* Prepare a sRGB version of the image and use it as source image. * Prepare a sRGB version of the image and use it as source image.
*/ */
$srgbDirName = "/srgb"; $srgbDirName = "/srgb";
$srgbDir = getConfig('srgb_dir', $cachePath . $srgbDirName); $srgbDir = realpath(getConfig('srgb_dir', $cachePath . $srgbDirName));
$srgbDefault = getConfig('srgb_default', false); $srgbDefault = getConfig('srgb_default', false);
$srgbColorProfile = getConfig('srgb_colorprofile', __DIR__ . '/../icc/sRGB_IEC61966-2-1_black_scaled.icc'); $srgbColorProfile = getConfig('srgb_colorprofile', __DIR__ . '/../icc/sRGB_IEC61966-2-1_black_scaled.icc');
$srgb = getDefined('srgb', true, null); $srgb = getDefined('srgb', true, null);
if ($srgb || $srgbDefault) { if ($srgb || $srgbDefault) {
if (!is_writable($srgbDir)) { if (!is_writable($srgbDir)) {
if (is_writable($cachePath)) { if (is_writable($cachePath)) {
mkdir($srgbDir); mkdir($srgbDir);
@@ -1018,6 +1024,7 @@ if ($status) {
$text .= "Allow remote images = $allowRemote\n"; $text .= "Allow remote images = $allowRemote\n";
$text .= "Cache writable = " . is_writable($cachePath) . "\n"; $text .= "Cache writable = " . is_writable($cachePath) . "\n";
$text .= "Cache dummy writable = " . is_writable($dummyDir) . "\n"; $text .= "Cache dummy writable = " . is_writable($dummyDir) . "\n";
$text .= "Cache srgb writable = " . is_writable($srgbDir) . "\n";
$text .= "Alias path writable = " . is_writable($aliasPath) . "\n"; $text .= "Alias path writable = " . is_writable($aliasPath) . "\n";
$no = extension_loaded('exif') ? null : 'NOT'; $no = extension_loaded('exif') ? null : 'NOT';