tasen / leptonica

Automatically exported from code.google.com/p/leptonica
0 stars 0 forks source link

pixWriteMem fails on win32 #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. use pixReadMem or pixWriteMem on win32
2. fails with "Error in pixWriteMemPng: png write to memory not implemented on 
this platform"

Is there a workaround instead of having to use the filesystem to read/write the 
files ?

Thank you,

Original issue reported on code.google.com by kpo...@gmail.com on 23 Jul 2010 at 4:33

GoogleCodeExporter commented 8 years ago
There is no workaround to my knowledge.

The gnu runtime supports non-posix functions (e.g., fmemopen())
that munge a stream ptr (FILE) to redirect the bytes to/from memory,
rather than to a file.  This doesn't exist on OSX either.

If you can find an equivalent function in the windows runtime and get it to
work, I'll be happy to include it.

Original comment by dan.bloo...@gmail.com on 23 Jul 2010 at 5:01

GoogleCodeExporter commented 8 years ago
Hi Dan,

thanks for your comments.
Given the fact that this function has to put the binary data in memory, isnt 
there a simple way to create a memory buffer and write there giving the total 
buffer size and address ?

Original comment by kpo...@gmail.com on 25 Jul 2010 at 5:50

GoogleCodeExporter commented 8 years ago
Dan, is there then a way to get the data of a variable holding an image ? 
Imagine one knows the width, height, bpp and the address of the image in 
memory. Is there a way to get the data there before freeing it ? Then one could 
use other libs for the conversion to a specific image format. And if possible, 
is the image representation a simple raw bitmap ?
I am asking this because having to save the image whenever one wants to get the 
data from other libs/code is really painful and slows down performance of the 
whole !
Thank you,

Original comment by kpo...@gmail.com on 30 Aug 2010 at 3:26