Last active
December 25, 2015 12:56
-
-
Save maximzasorin/409e7e26df086045b276 to your computer and use it in GitHub Desktop.
Модифицированный драйвер Imagick с конвертацией изображений в sRGB (HostCMS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Модифицированный драйвер Imagick с конвертацией изображений в sRGB | |
* | |
*/ | |
class Core_Image_Imagicksrgb extends Core_Image | |
{ | |
static public function resizeImage(/* ... */) | |
{ | |
//... | |
// Конвертируем в sRGB | |
$ext = Core_File::getExtension($targetFile); | |
$oImagick = new Imagick($targetFile); | |
if ($ext == 'jpg' || $ext == 'jpeg') | |
{ | |
$iccRgb = file_get_contents(CMS_FOLDER . '/hostcmsfiles/sRGB_v4_ICC_preference.icc'); | |
$oImagick->profileImage('icc', $iccRgb); | |
$oImagick->writeImage($targetFile); | |
$oImagick->clear(); | |
$oImagick->destroy(); | |
} | |
return TRUE; | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment