| core_text

# Class: Bs_Ocr Source Location: /core/text/Bs_Ocr.class.php
### Class Overview
    Bs_Object
       |
       --Bs_Ocr
dependencies: imagemagick http://www.imagemagick.com/ gocr http://jocr.sourceforge.net/ Bs_Dir, #### Author(s): andrej arn <at blueshoes dot org> #### Version: 4.5.$Revision: 1.11 $ $Date: 2003/10/29 17:48:42 $ #### Copyright: blueshoes.org | ### Variables $gocrPath $imageMagickPath $magickFileTypes | ### Methods Bs_Ocr fileToString
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 22] dependencies: imagemagick http://www.imagemagick.com/ gocr http://jocr.sourceforge.net/ Bs_Dir, #### Tags:
access: | public
since: | bs4.5
version: | 4.5.$Revision: 1.11 $ $Date: 2003/10/29 17:48:42 $
copyright: | blueshoes.org
author: | andrej arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $gocrPath = '' [line 47] the path to the gocr binary dir. if specified then has to end with a slash! #### Tags:
see: | var $imageMagickPath
access: | public
Type: | string
[ Top ] #### $imageMagickPath = '' [line 36] the path to the image magick binary dir. should not be needed since the binaries should be in the 'path' and thus reachable from everywhere. for example just type 'convert' in dos, no matter in what dir you are. if specified then has to end with a slash! #### Tags:
see: | var $gocrPath
access: | public
Type: | string
[ Top ] #### $magickFileTypes = array('art', 'avs', 'bmp', 'cgm', 'dcx', 'dib', 'dpx', 'emf', 'epdf', 'epi', 'eps', 'eps2', 'eps3', 'epsf', 'epsi', 'ept', 'fax', 'fig', 'gif', 'jng', 'jpeg', 'jpg', 'miff', 'mng', 'pbm', 'pcx', 'pict', 'pix', 'png', 'pnm', 'ppm', 'ps', 'ps2', 'ps3', 'psd', 'ptif', 'svg', 'tiff', 'tif', 'wmf') [line 54] the accepted image file types. we use imagemagick to convert these to 'pgm'.
Type: | array
[ Top ] ### Class Methods ### constructor Bs_Ocr [line 60]
`Bs_Ocr Bs_Ocr( )`
constructor. [ Top ] ### method fileToString [line 81]
`string fileToString( string $fileFullPath)`
takes an image and returns the parsed text. allowed image types: all better known image types, see the var $magickFileTypes for the full list. we use imagemagick to convert all of them to the grayscale 'pgm' format because gocr understands this. on linux gocr could go from jpg and others directly, but not on windows. unrecognized characters are represented using an underscore "_". #### Tags:
return: | (may be empty if nothing detected.)
throws: | bool FALSE (input file does not exist, not readable, not supported, or something failed.)
access: | public
#### Parameters:
string | $fileFullPath |
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:12:17 +0100 by phpDocumentor 1.2.3