Is there a way to remove silence at the end of files

Thanks, it seems a bit hopeless to me as my primary purpose was to find a way to remove those extra seconds of silence. And unfortunately I didn't keep a copy of the original files before they were being editted by iTunes. I've spent more than 10 years to collect all those files, and it's really frustrating to know that I may have ruined those files.

All of the covers I use are 600x600 or larger, and the file sizes for the ones I grabbed are anywhere from 92KB to 572KB.

I have added a total of 6 covers now, then deleted them, and repeated this 10 times in iTunes to a copy of the original file so I can compare both.

Windows reports the original file has a size of 14.4MB. When I added these 6 covers, the copied file increased to 16.5MB, so a substantial increase due to the images. The copy of the file I changed after adding/removing all images 10 times has dropped back down to 14.5MB, so some minor padding remains. But even now after adding and removing all these covers many times, the audio length remains at 6:18, so no blank audio has been added here.

I can guarantee you that if millions of iTunes users were seeing blank audio added to the end of their files, this would be a known issue by now. So simply adding and removing artwork using this program is not the isolated cause for the problem. Which is why I asked if you have some other program involved somewhere.

Trimming the silence from the files you have left will be a very manual process I'm afraid. There are tools out there for this, but nothing automatic that I am aware of, or would trust to do this in a mass file effort. Before going down that path though, I would really recommend you try to find the root cause of this. And before any further changes are done, back up what you have now.

This part is not accurate. Padding for the header does not increase the audio length of a file at any time. They are two very different things.

I think I remember "mp3trim" which removes silence from files - it apparently now exists as mptrim:
https://www.mptrim.com/
(external page, take care whether you really want to follow that link).

Mp3Directcut also does this job (and a lot more).
https://mpesch3.de/

Thanks and I think you are right. I've upgraded by Mac OS from Mojave to Catlina last weekend, and in the new Apple Music which is the automatic replacement to iTunes, there's no such problem whatsoever. I think there's a chance that the previous OS has some errors that lead to that issue.

But unfortunately the damage is already done, as I run some initial tests using MP3diags, the majority of my files have lots of errors in terms of the audio stream. Since I have yet to spend time to read through the entire manual, just want to have a check with you guys, to what extent MP3diags can help fix errors to audio stream? Thank you so much.

Thanks, I'll look into that maybe later this week.

Thanks for the sharing

That depends a lot on the kind of damage.
I would carefully approach the whole thing:
first scan the collection,
then filter for 1 particular problem,
apply the fitting correction method using the leftmost hammer and select just 1 method and then see what that did to the files.

Just in case: backups would be nice.