const SRGB_EXIF_COLOR_SPACE = 'sRGB';
const SRGB_ICC_PROFILE_DESCRIPTION = 'sRGB IEC61966-2.1';
- function normaliseParams( $image, &$params ) {
+ public function normaliseParams( $image, &$params ) {
if ( !parent::normaliseParams( $image, $params ) ) {
return false;
}
return $res;
}
- function getScriptParams( $params ) {
+ protected function getScriptParams( $params ) {
$res = parent::getScriptParams( $params );
if ( isset( $params['quality'] ) ) {
$res['quality'] = $params['quality'];
return $res;
}
- function getMetadata( $image, $filename ) {
+ public function getMetadata( $image, $filename ) {
try {
$meta = BitmapMetadataHandler::Jpeg( $filename );
if ( !is_array( $meta ) ) {
* @return bool
*/
public function swapICCProfile( $filepath, array $colorSpaces,
- array $oldProfileStrings, $profileFilepath
+ array $oldProfileStrings, $profileFilepath
) {
global $wgExiftool;
// Make a regex out of the source data to match it to an array of color
// spaces in a case-insensitive way
- $colorSpaceRegex = '/'.preg_quote( $data[0], '/' ).'/i';
+ $colorSpaceRegex = '/' . preg_quote( $data[0], '/' ) . '/i';
if ( empty( preg_grep( $colorSpaceRegex, $colorSpaces ) ) ) {
// We can't establish that this file matches the color space, don't process it
return false;
}
- $profileRegex = '/'.preg_quote( $data[1], '/' ).'/i';
+ $profileRegex = '/' . preg_quote( $data[1], '/' ) . '/i';
if ( empty( preg_grep( $profileRegex, $oldProfileStrings ) ) ) {
// We can't establish that this file has the expected ICC profile, don't process it
return false;