davidcaron / pye57

Read and write e57 point clouds from Python
MIT License
68 stars 42 forks source link

Bad file signature while reading E57 written with pye57 #47

Open rajagopalps opened 9 months ago

rajagopalps commented 9 months ago

I am writing an E57 file using pye57.write_scan_raw() and I can load this e57 file in BIM Collab and Cloud Compare.

If i try to read back the same e57 file, there is an error about the file signature not being ASTM-E57.

e57_write = pye57.E57("sample.e57", mode='w')
e57_write.write_scan_raw(data_sample,  translation=scan_0_tra ) # I can load the this E57 file in BIM Collab and Cloud Compare

# read back written e57
e57new = pye57.E57("sample.e57", mode='r')

This last line throws an error. The error messages are:

e57new = pye57.E57("sample.e57", mode="r") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\vtk1\Lib\site-packages\pye57\e57.py", line 66, in init raise e File "C:\ProgramData\anaconda3\envs\vtk1\Lib\site-packages\pye57\e57.py", line 57, in init self.image_file = libe57.ImageFile(path, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pye57.libe57.E57Exception: file signature not ASTM-E57 (E57_ERROR_BAD_FILE_SIGNATURE)

Is there something I am not passing to write_scan_raw or not passing while calling pye57.E57 to read the written file?.

Thanks Rajagopal

dancergraham commented 7 months ago

Hello, Can you provide any more data about what went wrong? Have you had a look at the test_main.py file for an example of file writing?