Tuesday, July 20, 2010

6 years of Concept

I'm getting closer to an official release after 6 years of Concept. With countless nights of coding, countless days of testing and debugging and many friends to suggest new features, Concept has now commercial quality, although is under an open source license.
Without having a dead-line, I'm trying to create a safe, fast and powerful platform that integrates the best technologies, without focusing on a specific platform.

Concept is ready to bring back the fun in coding.

6 years and 2 days ago, in an afternoon I've started this project.

Sunday, July 11, 2010

OCR in Concept Framework

I've included tesseract in Concept Framework. It's a really nice OCR library and I'm impressed by the quality of the character recognition. I've tried to keep the APIs really simple: just 2 functions, one for debugging and one for the actual OCR.

Prototype looks like this:

number OCR(szImage_filename, refOutText, szLanguage="eng", szDataPath="", szConfigFile="");

It returns OCR_E_CANT_OPEN or OCR_E_CANT_READ if error, or 0 otherwise.

A basic example:

import standard.lib.ocr

class Main {
function Main() {
// if debug file is not set, nul or /dev/null is assumed
//OCRDebugFile("");
if (!OCR("cap.bmp", var data))
echo data;
}
}

I hope is as straight forward as it can be.

This morning I've realized that although the framework has many PDF writing APIs (like libharu and PDFLib), it has no PDF reading APIs. So, I've integrated poppler (already used by de Concept Client). Now you can convert PDFs to images or extract text.

The APIs are pretty basic:

import standard.lib.poppler
import standard.C.io

class Main {
function Main() {
var pdf=PDFLoadBuffer(ReadFile("test.pdf"), "", var err);
if (pdf) {
var pages=PDFPageCount(pdf);
echo "Document has $pages pages\n";
for (var i=0;i<pages;i++) {
echo "Page ${i+1}:\n";
echo "==============";
// extract the text
echo PDFPageText(pdf, i);
// extract page as an image
echo PDFPageImage(pdf, i, "page_$i.png");
echo "==============";
}
// Don't forget to close !
PDFClose(pdf);
}
}
}

(sorry for the indentation, blogspot didn't handle it very well)

Thursday, July 8, 2010

UTF8 string functions and MetaObjects for Gyro

UTF8 functions like UTF8Length are now available in standard.lib.str.

Also, Gyro generates now Meta Object interface for each entity. This enables the developer to "populate" only the needed properties for an object instead of reading the whole object. This is useful in http:// applications, minimizing the database traffic.

I'm currently working on the new RadGs website, hope to have it online soon !