Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AddPicture take a slice of bytes or a reader #259

Closed
martskins opened this issue Aug 8, 2018 · 3 comments
Closed

Make AddPicture take a slice of bytes or a reader #259

martskins opened this issue Aug 8, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@martskins
Copy link

Having this method take a slice of bytes or a reader, instead of a path, would be extremely helpful.
I'm currently using a fork that has an alternate version of AddPicture that does this so I can use it in a lambda function in AWS (which does not have a file system).

One thing I'm not entirely sure is what is the purpose of this field pic.NvPicPr.CNvPr.Descr = file (that assignmed is found in the addDrawingPicture method. My forked version is working with that assignment commented out, but I'm not sure if it breaks anything else. There are no obvious referrers neither.

If that field isn't exactly needed and having a version of AddPicture that accepts bytes is considered useful, I would be willing to submit a PR or help with the implementation.

@xuri xuri added the enhancement New feature or request label Aug 9, 2018
@martskins
Copy link
Author

should I try and submit a PR for this? my initial idea was to create a new addPictureFromBytes method, so it shouldn't break anything

@dolmen
Copy link
Contributor

dolmen commented Sep 13, 2018

I had the same issue, and to workaround I had to create a temporary directory to dump my image file data. This is a dirty hack and I would be happy to drop it.

So I would be very happy if this feature is implemented and I will help with the review of an implementation.

@martskins
Copy link
Author

@dolmen I opened a PR, #271, it's basically a copy paste of the original function with some changes to enable passing a slice of bytes. Feel free to comment on it or suggest changes, I didn't really put much time into it as I needed it kinda fast.

@xuri xuri closed this as completed in 6ced438 Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants