mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-16 21:14:09 +02:00
Added conversion to sRGB using option , partly working, #120
This commit is contained in:
@@ -10,6 +10,9 @@ echo "Extension exif is $no loaded.<br>";
|
||||
$no = extension_loaded('curl') ? null : 'NOT';
|
||||
echo "Extension curl is $no loaded.<br>";
|
||||
|
||||
$no = extension_loaded('imagick') ? null : 'NOT';
|
||||
echo "Extension imagick is $no loaded.<br>";
|
||||
|
||||
$no = extension_loaded('gd') ? null : 'NOT';
|
||||
echo "Extension gd is $no loaded.<br>";
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
$version = "v0.7.7 (2015-10-21)";
|
||||
$version = "v0.7.7* (2015-10-21)";
|
||||
|
||||
|
||||
|
||||
@@ -972,6 +972,39 @@ if ($dummyImage === true) {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Prepare a sRGB version of the image and use it as source image.
|
||||
*/
|
||||
$srgbDirName = "/srgb";
|
||||
$srgbDir = getConfig('srgb_dir', $cachePath . $srgbDirName);
|
||||
$srgb = getDefined('srgb', true, null);
|
||||
|
||||
if ($srgb) {
|
||||
|
||||
if (!is_writable($srgbDir)) {
|
||||
if (is_writable($cachePath)) {
|
||||
mkdir($srgbDir);
|
||||
}
|
||||
}
|
||||
|
||||
$filename = $img->convert2sRGBColorSpace(
|
||||
$srcImage,
|
||||
$imagePath,
|
||||
$srgbDir,
|
||||
$useCache
|
||||
);
|
||||
|
||||
if ($filename) {
|
||||
$srcImage = $img->getTarget();
|
||||
$imagePath = null;
|
||||
verbose("srgb conversion and saved to cache = $srcImage");
|
||||
} else {
|
||||
verbose("srgb not op");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Display status
|
||||
*/
|
||||
@@ -990,6 +1023,9 @@ if ($status) {
|
||||
$no = extension_loaded('curl') ? null : 'NOT';
|
||||
$text .= "Extension curl is $no loaded.<br>";
|
||||
|
||||
$no = extension_loaded('imagick') ? null : 'NOT';
|
||||
$text .= "Extension imagick is $no loaded.<br>";
|
||||
|
||||
$no = extension_loaded('gd') ? null : 'NOT';
|
||||
$text .= "Extension gd is $no loaded.<br>";
|
||||
|
||||
|
BIN
webroot/img/car_srgb.png
Normal file
BIN
webroot/img/car_srgb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 245 KiB |
Reference in New Issue
Block a user