Displaying 6 results from an estimated 6 matches for "stdout_to_str".
2008 Jul 30
3
Dealing with image PDF's
...looks like:
// Tiff:
} else if (startswith(mimetype, "image/tif"))
{
// Inspired by http://mjr.towers.org.uk/comp/sxw2text
string safefile = shell_protect(file);
string cmd = "tifftopnm " + safefile + " | gocr -f UTF8 -";
try {
dump = stdout_to_string(cmd);
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
return;
}
// Tiff:End
I don't really understand all the code in omindex.cc but was wondering
if I could OCR when no text was returned whi...
2008 Jul 30
3
Dealing with image PDF's
...looks like:
// Tiff:
} else if (startswith(mimetype, "image/tif"))
{
// Inspired by http://mjr.towers.org.uk/comp/sxw2text
string safefile = shell_protect(file);
string cmd = "tifftopnm " + safefile + " | gocr -f UTF8 -";
try {
dump = stdout_to_string(cmd);
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
return;
}
// Tiff:End
I don't really understand all the code in omindex.cc but was wondering
if I could OCR when no text was returned whi...
2009 Feb 03
1
PowerPoint 2007 filter
...ng cmd = "unzip -p " + safefile + " ppt/slides/slide*.xml
ppt/notesSlides/notesSlide*.xml ppt/comments/comment*.xml"; */
string cmd = "unzip -p " + safefile + " ppt/slides/slide*.xml";
try {
XmlParser xmlparser;
xmlparser.parse_html(stdout_to_string(cmd));
dump = xmlparser.dump;
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
return;
}
// End: PowerPoint 2007 .pptx
FYI the mime type I entered was:
mime_map["pptx"] =
"...
2008 Jul 29
1
xapian-omega runfilter.cc patch
...-security -Wconversion -fno-gnu-keywords -Wundef -Wshadow -Winit-self -Wstrict-overflow=5 -fvisibility=hidden -O2 -pipe -march=prescott -fno-strict-aliasing -I/usr/local/include -MT runfilter.o -MD -MP -MF .deps/runfilter.Tpo -c -o runfilter.o runfilter.cc
runfilter.cc: In function 'std::string stdout_to_string(const std::string&)':
runfilter.cc:69: error: 'SIGCHLD' was not declared in this scope
runfilter.cc:69: error: 'SIG_DFL' was not declared in this scope
runfilter.cc:69: error: 'signal' was not declared in this scope
*** Error code 1
Please CC: me on any replies a...
2006 Oct 02
1
Omindex.cc BSD bug
...I was trying to index a large set of PDF documents using omindex
and the system started to run out of forks (sh: fork temporarily
unavailable) making the system unusable and probably skipping documents.
I'm using MAC Osx Server 10.4.3 (Darwin/BSD) and GCC 4.0.
The problem: On function stdout_to_string a popen is called, but is not
closed properly (according the popen manual) because is using fclose instead
of pclose and hence processes created by popen are not killed.
Solution: Omindex.cc line 201, replace fclose by pclose :
If (pclose(sh) == -1) throw read ReadError();
This must correct t...
2009 Feb 02
2
Ticket #282: omindex-assorted-enhancements.patch woes
.../rtf") {
// The --text option unhelpfully converts all non-ASCII characters to
// "?" so we use --html instead, which produces HTML entities.
- string cmd = "unrtf --nopict --html 2>/dev/null " +
shell_protect(file);
MyHtmlParser p;
try {
- p.parse_html(stdout_to_string(cmd));
} catch (ReadError) {
cout << "\"" << cmd << "\" failed - skipping\n";
return;
--- 426,435 ----
} else if (mimetype == "text/rtf") {
// The --text option unhelpfully converts all non-ASCII characters to...