It looks like the problem is either in the huge metadata section or broken structure.It's very interesting to see what's inside a particular file.Can you resize file to 1x1 pixel and attach it to the post?(this should not affect the metadata)
i use your script it work on files, thank you so much for your help.
i want to ask for one more help. we have too much file with huge metadata, so we cant open every single file and run script on it. is any way is available to run script on every file without open in photoshop..
I use exiftool with the command
exiftool -r -overwrite_original -XMP-photoshop:DocumentAncestors= "location of My Problem Folder Full of Bloated Images"