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

Wishlist: Read/Save from Stream on Pix #219

Open
haf opened this issue Oct 25, 2015 · 5 comments
Open

Wishlist: Read/Save from Stream on Pix #219

haf opened this issue Oct 25, 2015 · 5 comments

Comments

@haf
Copy link

haf commented Oct 25, 2015

It would be great if a few of the methods from https://tpgit.github.io/Leptonica/pngio_8c.html were exposed, such as reading/saving to streams for Pix. That way there's no need to create lots of files on disk during normal operations.

@charlesw
Copy link
Owner

I don't think this is possible as the in memory streaming (i.e. pixReadMemPng()) is not available on windows. That being said most of the api's do support loading a Pix from an in memory array provided you know the image format (i.e. if it's a Tiff or Jpeg etc). Obviously this is not as efficient as loading from a stream but might be the best compromise.

@ghost
Copy link

ghost commented Aug 8, 2017

Hi Charles,
I am interested in this as well, does the current pre release offer any support for this ? Or can you maybe provide some info on how to perhaps pass a file as a memory stream to the pix ?

Kind regards,

Helgard Wagener

@sansjunk
Copy link

The need for reading from stream/byte array is even more essential now that the package supports .NET Core. Understandably none of the System.Drawing.Bitmap related API (ex: PixConverter) are available for .NET Core so the only way to load an image is via Pix.LoadFromFile and this only takes the path to a file on disk. Though there is Pix.LoadTiffFromMemory it only supports TIFF files.

Another option is to use the System.Drawing.Common package to enable PixConverter for .NET Core.

@sansjunk
Copy link

I just enabled BitmapToPixConverter using System.Drawing.Common package and it works great so this definitely is one way to go.

@charlesw
Copy link
Owner

charlesw commented Dec 27, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants