Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ public function ParseID3v2Frame(&$parsedFrame) {
$parsedFrame['image_mime'] = '';
$imageinfo = array();
$imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data'], $imageinfo);
if (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) {
if (is_array($imagechunkcheck) && ($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) {
$parsedFrame['image_mime'] = 'image/'.getid3_lib::ImageTypesLookup($imagechunkcheck[2]);
if ($imagechunkcheck[0]) {
$parsedFrame['image_width'] = $imagechunkcheck[0];
Expand Down Expand Up @@ -1870,17 +1870,14 @@ public function ParseID3v2Frame(&$parsedFrame) {
$frame_offset = 0;
$parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4));
$frame_offset += 4;
$rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
$frame_offset += 2;
$rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
$parsedFrame['raw']['track']['name'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3));
$parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3));
$parsedFrame['raw']['track']['signbit'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1));
$parsedFrame['raw']['track']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 7, 9));
$parsedFrame['raw']['album']['name'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 0, 3));
$parsedFrame['raw']['album']['originator'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 3, 3));
$parsedFrame['raw']['album']['signbit'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 6, 1));
$parsedFrame['raw']['album']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 7, 9));
foreach (array('track','album') as $rgad_entry_type) {
$rg_adjustment_word = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
$frame_offset += 2;
$parsedFrame['raw'][$rgad_entry_type]['name'] = ($rg_adjustment_word & 0xE000) >> 13;
$parsedFrame['raw'][$rgad_entry_type]['originator'] = ($rg_adjustment_word & 0x1C00) >> 10;
$parsedFrame['raw'][$rgad_entry_type]['signbit'] = ($rg_adjustment_word & 0x0200) >> 9;
$parsedFrame['raw'][$rgad_entry_type]['adjustment'] = ($rg_adjustment_word & 0x0100);
}
$parsedFrame['track']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']);
$parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']);
$parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']);
Expand Down
16 changes: 11 additions & 5 deletions christophwurst/id3parser/src/getID3/getid3_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,20 @@ public static function BigEndian2String($number, $minbytes=1, $synchsafe=false,


public static function Dec2Bin($number) {
if (!is_numeric($number)) {
// https://github.com/JamesHeinrich/getID3/issues/299
trigger_error('TypeError: Dec2Bin(): Argument #1 ($number) must be numeric, '.gettype($number).' given', E_USER_WARNING);
return '';
}
$bytes = array();
while ($number >= 256) {
$bytes[] = (($number / 256) - (floor($number / 256))) * 256;
$bytes[] = (int) (($number / 256) - (floor($number / 256))) * 256;
$number = floor($number / 256);
}
$bytes[] = $number;
$bytes[] = (int) $number;
$binstring = '';
for ($i = 0; $i < count($bytes); $i++) {
$binstring = (($i == count($bytes) - 1) ? decbin($bytes[$i]) : str_pad(decbin($bytes[$i]), 8, '0', STR_PAD_LEFT)).$binstring;
foreach ($bytes as $i => $byte) {
$binstring = (($i == count($bytes) - 1) ? decbin($byte) : str_pad(decbin($byte), 8, '0', STR_PAD_LEFT)).$binstring;
}
return $binstring;
}
Expand Down Expand Up @@ -1147,7 +1153,7 @@ public static function trimNullByte($string) {
* @param string $suffix If the name component ends in suffix this will also be cut off.
* @return string
*/
public static function mb_basename($path, $suffix = null) {
public static function mb_basename($path, $suffix = '') {
$splited = preg_split('#/#', rtrim($path, '/ '));
return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"php": "^7.3|^8.0",
"aws/aws-sdk-php": "^3.35",
"bantu/ini-get-wrapper": "v1.0.1",
"christophwurst/id3parser": "^0.1.1",
"christophwurst/id3parser": "^0.1.4",
"cweagans/composer-patches": "^1.7",
"deepdiver/zipstreamer": "2.0.0",
"deepdiver1975/tarstreamer": "v2.0.0",
Expand Down
18 changes: 11 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4()

/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
* @psalm-return array<string, string>
*/
public function getClassMap()
{
Expand Down
12 changes: 12 additions & 0 deletions composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,15 @@
'Pimple\\Psr11\\ServiceLocator' => $vendorDir . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
'Pimple\\ServiceIterator' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceIterator.php',
'Pimple\\ServiceProviderInterface' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
'Pimple\\Tests\\Fixtures\\Invokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
'Pimple\\Tests\\Fixtures\\NonInvokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
'Pimple\\Tests\\Fixtures\\Service' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
'Pimple\\Tests\\PimpleTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
'Pimple\\Tests\\Psr11\\ContainerTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
'Pimple\\Tests\\ServiceIteratorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
Comment on lines +2091 to +2099
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nop?

'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
Expand Down Expand Up @@ -2116,6 +2125,9 @@
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
'Punic\\Calendar' => $vendorDir . '/punic/punic/code/Calendar.php',
'Punic\\Comparer' => $vendorDir . '/punic/punic/code/Comparer.php',
'Punic\\Currency' => $vendorDir . '/punic/punic/code/Currency.php',
Expand Down
9 changes: 7 additions & 2 deletions composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,16 @@ public static function getLoader()
}
}

/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

require $file;
}
}
12 changes: 12 additions & 0 deletions composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -2728,6 +2728,15 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Pimple\\Psr11\\ServiceLocator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
'Pimple\\ServiceIterator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceIterator.php',
'Pimple\\ServiceProviderInterface' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
'Pimple\\Tests\\Fixtures\\Invokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
'Pimple\\Tests\\Fixtures\\NonInvokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
'Pimple\\Tests\\Fixtures\\Service' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
'Pimple\\Tests\\PimpleTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
'Pimple\\Tests\\Psr11\\ContainerTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
'Pimple\\Tests\\ServiceIteratorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
Expand Down Expand Up @@ -2756,6 +2765,9 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
'Punic\\Calendar' => __DIR__ . '/..' . '/punic/punic/code/Calendar.php',
'Punic\\Comparer' => __DIR__ . '/..' . '/punic/punic/code/Comparer.php',
'Punic\\Currency' => __DIR__ . '/..' . '/punic/punic/code/Currency.php',
Expand Down
18 changes: 11 additions & 7 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,23 @@
},
{
"name": "christophwurst/id3parser",
"version": "v0.1.1",
"version_normalized": "0.1.1.0",
"version": "v0.1.4",
"version_normalized": "0.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/ChristophWurst/ID3Parser.git",
"reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da"
"reference": "050c9d81ea89b0cf53e23a27efc4e1840f9ab260"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/c0e56c336bd6131c199827f928e5a9aec89aa4da",
"reference": "c0e56c336bd6131c199827f928e5a9aec89aa4da",
"url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/050c9d81ea89b0cf53e23a27efc4e1840f9ab260",
"reference": "050c9d81ea89b0cf53e23a27efc4e1840f9ab260",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"time": "2020-01-07T09:05:03+00:00",
"time": "2021-11-29T15:02:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -290,6 +290,10 @@
"php",
"tags"
],
"support": {
"issues": "https://github.com/ChristophWurst/ID3Parser/issues",
"source": "https://github.com/ChristophWurst/ID3Parser/tree/v0.1.4"
},
"install-path": "../christophwurst/id3parser"
},
{
Expand Down Expand Up @@ -6341,6 +6345,6 @@
"install-path": "../web-auth/webauthn-lib"
}
],
"dev": false,
"dev": true,
"dev-package-names": []
}
12 changes: 6 additions & 6 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '34a8469e1633be33aa57119d8e5f02808db33eae',
'reference' => 'fde26117e66ae3556c87a90b63e99a14231949c0',
'name' => 'nextcloud/3rdparty',
'dev' => false,
'dev' => true,
),
'versions' => array(
'aws/aws-sdk-php' => array(
Expand Down Expand Up @@ -47,12 +47,12 @@
'dev_requirement' => false,
),
'christophwurst/id3parser' => array(
'pretty_version' => 'v0.1.1',
'version' => '0.1.1.0',
'pretty_version' => 'v0.1.4',
'version' => '0.1.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../christophwurst/id3parser',
'aliases' => array(),
'reference' => 'c0e56c336bd6131c199827f928e5a9aec89aa4da',
'reference' => '050c9d81ea89b0cf53e23a27efc4e1840f9ab260',
'dev_requirement' => false,
),
'composer/package-versions-deprecated' => array(
Expand Down Expand Up @@ -304,7 +304,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'reference' => '34a8469e1633be33aa57119d8e5f02808db33eae',
'reference' => 'fde26117e66ae3556c87a90b63e99a14231949c0',
'dev_requirement' => false,
),
'nextcloud/lognormalizer' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class Versions
'bantu/ini-get-wrapper' => 'v1.0.1@4770c7feab370c62e23db4f31c112b7c6d90aee2',
'beberlei/assert' => 'v3.3.0@5367e3895976b49704ae671f75bc5f0ba1b986ab',
'brick/math' => '0.9.1@283a40c901101e66de7061bd359252c013dcc43c',
'christophwurst/id3parser' => 'v0.1.1@c0e56c336bd6131c199827f928e5a9aec89aa4da',
'christophwurst/id3parser' => 'v0.1.4@050c9d81ea89b0cf53e23a27efc4e1840f9ab260',
'composer/package-versions-deprecated' => '1.11.99.1@7413f0b55a051e89485c5cb9f765fe24bb02a7b6',
'cweagans/composer-patches' => '1.7.1@9888dcc74993c030b75f3dd548bb5e20cdbd740c',
'deepdiver/zipstreamer' => '2.0.0@b8c59647ff34fb97e8937aefb2a65de2bc4b4755',
Expand Down Expand Up @@ -121,7 +121,7 @@ final class Versions
'web-auth/cose-lib' => 'v3.3.9@ed172d2dc1a6b87b5c644c07c118cd30c1b3819b',
'web-auth/metadata-service' => 'v3.3.9@8488d3a832a38cc81c670fce05de1e515c6e64b1',
'web-auth/webauthn-lib' => 'v3.3.9@04b98ee3d39cb79dad68a7c15c297c085bf66bfe',
'nextcloud/3rdparty' => 'dev-master@34a8469e1633be33aa57119d8e5f02808db33eae',
'nextcloud/3rdparty' => 'dev-master@fde26117e66ae3556c87a90b63e99a14231949c0',
);

private function __construct()
Expand Down