Skip to content

Commit

Permalink
Более корректное обозначение версии PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
Finesse committed Nov 17, 2015
1 parent 90abbd4 commit 1479b86
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
],
"require": {
"php": ">=4.3.2"
"php": ">=5.3"
},
"autoload": {
"psr-4": { "AigerTeam\\ImageTools\\": "src/" }
Expand Down
20 changes: 10 additions & 10 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function write(
$text,
$font,
$fontSize = 12,
Array $color = [ 'r' => 0, 'g' => 0, 'b' => 0 ],
Array $color = Array( 'r' => 0, 'g' => 0, 'b' => 0 ),
$x = 0,
$y = 0,
$alignHor = 0,
Expand Down Expand Up @@ -452,7 +452,7 @@ public function getKMeanColors( $amount = 1, $sort = true, $maxPreSize = 30, $ep
for ( $j = 0; $j < 3; ++$j )
$clusters[ $i ][ $j ] = floor( $clusters[ $i ][ $j ] );

$ret = [];
$ret = Array();
for ( $i = 0; $i < $amount; ++$i )
$ret[] = Array(
'r' => $clusters[ $i ][ 0 ],
Expand Down Expand Up @@ -629,28 +629,28 @@ protected static function getResizeParameters(
if ( $desWidth === $curWidth || !$allowIncrease && $desWidth > $curWidth )
return null;

return [
return Array(
'srcX' => 0,
'srcY' => 0,
'srcWidth' => $curWidth,
'srcHeight' => $curHeight,
'dstWidth' => $desWidth,
'dstHeight' => round( $desWidth * $curHeight / $curWidth )
];
);
}
elseif ( is_null( $desWidth ) ) // Приведение высоты к нужному значению
{
if ( $desHeight === $curHeight || !$allowIncrease && $desHeight > $curHeight )
return null;

return [
return Array(
'srcX' => 0,
'srcY' => 0,
'srcWidth' => $curWidth,
'srcHeight' => $curHeight,
'dstWidth' => round( $desHeight * $curWidth / $curHeight ),
'dstHeight' => $desHeight
];
);
}
elseif ( $sizing === static::SIZING_EXEC ) // Просто изменить размеры до указанных, плюнув на пропорции
{
Expand All @@ -664,14 +664,14 @@ protected static function getResizeParameters(
)
return null;

return [
return Array(
'srcX' => 0,
'srcY' => 0,
'srcWidth' => $curWidth,
'srcHeight' => $curHeight,
'dstWidth' => $allowIncrease ? $desWidth : min( $desWidth, $curWidth ),
'dstHeight' => $allowIncrease ? $desHeight : min( $desHeight, $curHeight )
];
);
}
elseif ( $sizing === static::SIZING_CONTAIN || $sizing === static::SIZING_COVER ) // Пропорции изображения сохраняются и оно вписывается в размер
{
Expand Down Expand Up @@ -699,14 +699,14 @@ protected static function getResizeParameters(
$srcX = round( ( $curWidth - $srcWidth ) * $alignHor );
$srcY = round( ( $curHeight - $srcHeight ) * $alignVer );

return [
return Array(
'srcX' => $srcX,
'srcY' => $srcY,
'srcWidth' => $srcWidth,
'srcHeight' => $srcHeight,
'dstWidth' => min( $desWidth, round( $curWidth * $scale ) ),
'dstHeight' => min( $desHeight, round( $curHeight * $scale ) )
];
);
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion src/ImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function_exists( 'exif_read_data' ) &&
isset( $exif[ 'IFD0' ][ 'Orientation' ] )
) {
switch( $exif[ 'IFD0' ][ 'Orientation' ] ) {
case 8: $image->rotate( 90 ); break;
case 8: $image->rotate( 90 ); break;
case 3: $image->rotate( 180 ); break;
case 6: $image->rotate( -90 ); break;
}
Expand Down

0 comments on commit 1479b86

Please sign in to comment.