davidcaron / pye57

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

add read buffer on blobnode wrapper #12

Closed Totorro35 closed 2 years ago

Totorro35 commented 3 years ago

Description

Add a read_buffer method to BlobNode wrapper

You can use this method to read jpegImage buffer and save cubemap data from .e57 file

Example

e57 = pye57.E57("test.e57")
jpeg_buffer = e57.root["images2D"][0]["pinholeRepresentation"]["jpegImage"].read_buffer()
with open("out_0.jpg", "wb") as _f:
        _f.write(jpeg_buffer)
Totorro35 commented 3 years ago

I used a copy to keep the const but actually I didn't think about the memory leak.

Sorry I don't have a small file, I only work with big projects.

davidcaron commented 2 years ago

Sorry for the very long delay, I'll try to add a test for this once I get a small dataset.

Thanks!