Just starting a PR based on #85 and came across a weird issue. It appears the certain malformed AIFF files cannot be read under certain conditions. If we use the example in python:
import puremagic
with open(r"r:\aiff\Fnonull.aif", "rb") as file:
print(puremagic.magic_stream(file))
We get:
Traceback (most recent call last):
File "R:\WinUAE\pm.py", line 3, in <module>
print(puremagic.magic_stream(file))
File "C:\Users\Andy\AppData\Local\Programs\Python\Python310\lib\site-packages\puremagic\main.py", line 351, in magic_stream
head, foot = _stream_details(stream)
File "C:\Users\Andy\AppData\Local\Programs\Python\Python310\lib\site-packages\puremagic\main.py", line 229, in _stream_details
stream.seek(-max_foot, os.SEEK_END)
OSError: [Errno 22] Invalid argument
From reading around it appears to have something to do with malformed files and seek errors, but I can't quite see how Puremagic can read it one way and not the other.
Any thoughts on this?
Test files.
aiff.zip
The files causing trouble are the ones labelled as Perverse Files from this page Samples
Just starting a PR based on #85 and came across a weird issue. It appears the certain malformed AIFF files cannot be read under certain conditions. If we use the example in python:
We get the following:
However, if we do the following in a .py file
We get:
From reading around it appears to have something to do with malformed files and seek errors, but I can't quite see how Puremagic can read it one way and not the other.
Any thoughts on this?
Test files.
aiff.zip The files causing trouble are the ones labelled as
Perverse Files
from this page Samples