-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RemoveID3v2 avdataoffset issue when id3v1 and id3v2 #314
Comments
easy way to repeat, the code for writing is the same:
But if I run the analyze() before WriteTags(), there is no errors |
After removing from the laravel, the error is not reproduced. |
Continuation of the survey. The following code has been written which does not work as expected: require_once('vendor/james-heinrich/getid3/getid3/getid3.php');
require_once('vendor/james-heinrich/getid3/getid3/write.php');
$TagData = ['title' => ['Title me']];
$path = '1second.mp3';
for ($a=1; $a<=6; $a++) {
if ($a%2) {
$TagFormatsToWrite = ['id3v1', 'id3v2.4'];
} else {
$TagFormatsToWrite = ['id3v2.4'];
}
$tagwriter = new \getid3_writetags;
$tagwriter->filename = $path;
$tagwriter->tagformats = $TagFormatsToWrite;
$tagwriter->overwrite_tags = true;
$tagwriter->tag_encoding = 'UTF-8';
$tagwriter->remove_other_tags = true;
$tagwriter->tag_data = $TagData;
if ($tagwriter->WriteTags()) {
if (!empty($tagwriter->warnings)) {
echo 'WriteTags '.$a.' warnings: '.implode($tagwriter->warnings)."\n";
} else {
echo 'Tags '.$a.' update'."\n";
}
} else {
echo 'WriteTags '.$a.' errors: '.implode($tagwriter->errors)."\n";
}
} result for 1second.mp3
result for cbr320mb10.mp3 is no error "remove_other_tags" set to "false" works without errors on PHP 7.3.27 same problem |
Hello,
The problem does not appear when you use only id3v2
PHP 7.4.16
GETID3_VERSION 1.9.20-202006061653
Code:
write 'id3v1', 'id3v2.4':
delete ''id3v2':
before delete get analyze:
file cbr320mb10.mp3:
analyze result:
dump $OldThisFileInfo in RemoveID3v2() result:
The error is that he does not see the id3v1 tag? Although there is no such problem when analyzing
file 1second.mp3:
analyze result:
dump $OldThisFileInfo in RemoveID3v2() result:
and error:
if run a second time, there are no problems and errors, but the id3v1 tag also disappears
thx
The text was updated successfully, but these errors were encountered: