Open akavel opened 3 years ago
Mateusz,
Thanks for your interest in Metar. The IPFS project looks cool and has a lot of potential.
Here is the outline I think you should follow for adding in memory buffer support to metar.
Metar's current public interface in Nim:
Add the following procedure to the public interface:
For python, the new public method would be called:
Private interface changes:
Both the existing readMetadata, readMetadataJson procedures and the new readMetadataBuffer procedure change to call the new readMetadataStream procedure.
All low level procedures that take a file parameter change to take a stream parameter.
Steve
Steve,
Thank you for the suggestions; in particular, I didn't realize that Stream has a setPosition method - with this existing, at first glance it looks like it should hopefully be fairly easy to do for me!
Now, just regarding the python new public method: I never did this; does it mean just that I'd need to add an {.exportpy: "read_metadata_buffer".} annotation, or is there something more I'd need to do?
edit: Also, starting to work on this, I've realized that in my project, I'm actually using the getMetadata procedure (as it gives me a fully typed, structured object with a really useful set of methods). What would be your suggested approach to changing it? Would you prefer if I tried adding a new getMetadataStream, and modifying getMetadata to be just a thin wrapper over it, or if just didn't care about that and modified getMetadata to take a stream as its argument?
Thanks, /M.
Mateusz,
You are right about read_metadata_buffer, nimpy makes it easy. Make sure you put it in the same module as the other public procedures.
Steve
"read_metadata_buffer On Fri, Mar 26, 2021 at 2:06 AM Mateusz Czapliński < @.***> wrote:
Steve,
Thank you for the suggestions; in particular, I didn't realize that Stream has a setPosition method - with this existing, at first glance it looks like it should hopefully be fairly easy to do for me!
Now, just regarding the python new public method: I never did this; does it mean just that I'd need to add an {.exportpy: "read_metadata_buffer".} annotation, or is there something more I'd need to do?
Thanks, /M.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/flenniken/metar/issues/3#issuecomment-808055582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3UMKLKXEUVMAKYMXW2T3DTFRFAZANCNFSM4ZROCIQA .
Hi! I started using metar as an Exif parser for a hobby project for photo backups management. However, my plan for the project is to support IPFS backups soon. For this, I anticipate needing to support parsing Exif from in-memory buffers with JPEG data, not just from on-disk Files. I'd be ok with trying to add such feature to metar myself, and based on your preferences, trying to upstream it back to you, or just keeping it in a fork. The challenge I'm having, however, is that I'm not really sure how to best add such a feature to metar's library interface and implementation in Nim. Would you by chance have some ideas how you think I might try and approach it best? If you were interested in such a feature (regardless if that is currently true or not), do you think there's some shape you would possibly prefer it to look like?
Thanks, /M.