[BC] Upgraded dependencies, dropped support for anything below PHP 8.0. (#849)
* GitHub actions + style fixes + updated packages * Fixed workflows dir * Support for PHP 8.1 (#1) * Update README.md * Revert some changes from upstream
This commit is contained in:
parent
72c946dc7d
commit
111c153428
335 changed files with 4394 additions and 28116 deletions
|
|
@ -17,49 +17,49 @@ use FFMpeg\Exception\InvalidArgumentException;
|
|||
class AspectRatio
|
||||
{
|
||||
// named 4:3 or 1.33:1 Traditional TV
|
||||
const AR_4_3 = '4/3';
|
||||
public const AR_4_3 = '4/3';
|
||||
// named 16:9 or 1.77:1 HD video standard
|
||||
const AR_16_9 = '16/9';
|
||||
|
||||
public const AR_16_9 = '16/9';
|
||||
|
||||
// named 8:5 or 16:10 or 1.6:1
|
||||
const AR_8_5 = '8/5';
|
||||
public const AR_8_5 = '8/5';
|
||||
|
||||
// named 25:16 or 1.56:1
|
||||
const AR_25_16 = '25/16';
|
||||
public const AR_25_16 = '25/16';
|
||||
|
||||
// named 3:2 or 1.5:1 see http://en.wikipedia.org/wiki/135_film
|
||||
const AR_3_2 = '3/2';
|
||||
public const AR_3_2 = '3/2';
|
||||
// named 5:3 or 1.66:1 see http://en.wikipedia.org/wiki/Super_16_mm
|
||||
const AR_5_3 = '5/3';
|
||||
public const AR_5_3 = '5/3';
|
||||
|
||||
// mostly used in Photography
|
||||
const AR_5_4 = '5/4';
|
||||
const AR_1_1 = '1/1';
|
||||
public const AR_5_4 = '5/4';
|
||||
public const AR_1_1 = '1/1';
|
||||
|
||||
// 1.85:1 US widescreen cinema standard see http://en.wikipedia.org/wiki/Widescreen#Film
|
||||
const AR_1_DOT_85_1 = '1.85:1';
|
||||
public const AR_1_DOT_85_1 = '1.85:1';
|
||||
// 2.39:1 or 2.40:1 Current widescreen cinema standard see http://en.wikipedia.org/wiki/Anamorphic_format
|
||||
const AR_2_DOT_39_1 = '2.39:1';
|
||||
public const AR_2_DOT_39_1 = '2.39:1';
|
||||
|
||||
// Rotated constants
|
||||
|
||||
// Rotated 4:3
|
||||
const AR_ROTATED_3_4 = '3/4';
|
||||
public const AR_ROTATED_3_4 = '3/4';
|
||||
// Rotated 16:9
|
||||
const AR_ROTATED_9_16 = '9/16';
|
||||
public const AR_ROTATED_9_16 = '9/16';
|
||||
|
||||
// Rotated 3:2
|
||||
const AR_ROTATED_2_3 = '2/3';
|
||||
public const AR_ROTATED_2_3 = '2/3';
|
||||
// Rotated 5:3
|
||||
const AR_ROTATED_3_5 = '3/5';
|
||||
public const AR_ROTATED_3_5 = '3/5';
|
||||
|
||||
// Rotated 5:4
|
||||
const AR_ROTATED_4_5 = '4/5';
|
||||
public const AR_ROTATED_4_5 = '4/5';
|
||||
|
||||
// Rotated 1.85
|
||||
const AR_ROTATED_1_DOT_85 = '1/1.85';
|
||||
public const AR_ROTATED_1_DOT_85 = '1/1.85';
|
||||
// Rotated 2.39
|
||||
const AR_ROTATED_2_DOT_39 = '1/2.39';
|
||||
public const AR_ROTATED_2_DOT_39 = '1/2.39';
|
||||
|
||||
/** @var float */
|
||||
private $ratio;
|
||||
|
|
@ -82,10 +82,10 @@ class AspectRatio
|
|||
/**
|
||||
* Computes the best width for given height and modulus.
|
||||
*
|
||||
* @param Integer $height
|
||||
* @param Integer $modulus
|
||||
* @param int $height
|
||||
* @param int $modulus
|
||||
*
|
||||
* @return Integer
|
||||
* @return int
|
||||
*/
|
||||
public function calculateWidth($height, $modulus = 1)
|
||||
{
|
||||
|
|
@ -101,10 +101,10 @@ class AspectRatio
|
|||
/**
|
||||
* Computes the best height for given width and modulus.
|
||||
*
|
||||
* @param Integer $width
|
||||
* @param Integer $modulus
|
||||
* @param int $width
|
||||
* @param int $modulus
|
||||
*
|
||||
* @return Integer
|
||||
* @return int
|
||||
*/
|
||||
public function calculateHeight($width, $modulus = 1)
|
||||
{
|
||||
|
|
@ -120,7 +120,7 @@ class AspectRatio
|
|||
private function getMultipleUp($value, $multiple)
|
||||
{
|
||||
while (0 !== $value % $multiple) {
|
||||
$value++;
|
||||
++$value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
|
@ -129,7 +129,7 @@ class AspectRatio
|
|||
private function getMultipleDown($value, $multiple)
|
||||
{
|
||||
while (0 !== $value % $multiple) {
|
||||
$value--;
|
||||
--$value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
|
@ -141,8 +141,7 @@ class AspectRatio
|
|||
* The strategy parameter forces by default to use standardized ratios. If
|
||||
* custom ratio need to be used, disable it.
|
||||
*
|
||||
* @param Dimension $dimension
|
||||
* @param bool $forceStandards Whether to force or not standard ratios
|
||||
* @param bool $forceStandards Whether to force or not standard ratios
|
||||
*
|
||||
* @return AspectRatio
|
||||
*
|
||||
|
|
@ -214,7 +213,7 @@ class AspectRatio
|
|||
|
||||
private static function nearestStrategy($incoming)
|
||||
{
|
||||
$availables = array(
|
||||
$availables = [
|
||||
static::AR_4_3 => static::valueFromName(static::AR_4_3),
|
||||
static::AR_16_9 => static::valueFromName(static::AR_16_9),
|
||||
static::AR_8_5 => static::valueFromName(static::AR_8_5),
|
||||
|
|
@ -234,7 +233,7 @@ class AspectRatio
|
|||
static::AR_ROTATED_3_4 => static::valueFromName(static::AR_ROTATED_3_4),
|
||||
static::AR_ROTATED_1_DOT_85 => static::valueFromName(static::AR_ROTATED_1_DOT_85),
|
||||
static::AR_ROTATED_2_DOT_39 => static::valueFromName(static::AR_ROTATED_2_DOT_39),
|
||||
);
|
||||
];
|
||||
asort($availables);
|
||||
|
||||
$previous = $current = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue