Closed GoogleCodeExporter closed 8 years ago
The problem on windows and osx is that they do not include a function similar
to fmemopen() in the gnu runtime library, which allows you to read from memory
AS IF you were reading from a file stream.
If you look at environ.h, you'll see a discussion of this, where HAVE_FMEMOPEN
is manually set. (If you build using configure, this will be set to 0 in
config_auto.h)
It's not entirely satisfactory, but you can work around this by writing your
image data to file and reading from there.
Original comment by dan.bloo...@gmail.com
on 8 Mar 2013 at 9:24
Unfortunately user try to avoid save to disk. He want to run something like
this (with tesseract):
wget http://mi_server/image.jpg -q0- | tessaract --stdin --stdout | grep
$(important)
I would prefer if workaround is done by leptonica, so leptonica user should not
care about platform differences.
BTW: there is fmemopen for Mac OS and iOS(Apache 2.0 License)
https://github.com/jverkoey/fmemopen
open_memstream (Apache 2.0 License):
http://mirror.yongbok.net/pub/linux/android/repository/system/core/libcutils/ope
n_memstream.c
I also find implementations of fmemopen for win32 (licenced under GPL2):
http://fossies.org/unix/misc/suricata-1.4.1.tar.gz:a/suricata-1.4.1/src/util-fme
mopen.c
http://ejudge.ru/trac/browser/trunk/ejudge/win32/fmemopen.c
so I hope there could be better solution for windows and Mac than saving data
to file.
Original comment by zde...@gmail.com
on 10 Mar 2013 at 3:36
Original issue reported on code.google.com by
zde...@gmail.com
on 8 Mar 2013 at 5:34Attachments: