creatale / node-dv

A node.js library for processing and understanding scanned documents
Other
340 stars 72 forks source link

OSX build fix #32

Open diegoperini opened 8 years ago

diegoperini commented 8 years ago

Edit: Fixed minimum OSX

WolfgangFellger commented 8 years ago

Thank you. What exactly does "(tests fail)" mean? There's not much point in having the build "fixed" when it doesn't actually work...

diegoperini commented 8 years ago

Test results:

> dv@1.10.1 test /Users/diego/Projects/diego/node-dv
> mocha test

   Image
    ✓ should construct from raw data (grayscale)
    ✓ should construct from raw data (rgb)
    ✓ should construct from raw data (rgba)
    ✓ should save using #toBuffer() (573ms)
    ✓ should return raw image data using #toBuffer()
    ✓ should #invert() (144ms)
    ✓ should #or(), #and(), #xor(), #add() and #subtract() (337ms)
    ✓ should #add() and #subtract() arithmetically for grayscale
    ✓ should #add() and #subtract() arithmetically for rgb
    ✓ should #convolve()
    ✓ should #unsharp() (132ms)
    ✓ should #rotate() (339ms)
    ✓ should #scale() (454ms)
    ✓ should #crop()
    ✓ should #inRange()
    ✓ should #rankFilter() (149ms)
    ✓ should #toGray() (224ms)
    ✓ should #toHSV() and #toRGB() (153ms)
    ✓ should #erode() (148ms)
    ✓ should #dilate()
    ✓ should #open() (152ms)
    ✓ should #close() (129ms)
    ✓ should #thin()
    ✓ should #otsuAdaptiveThreshold(), #findSkew()
    ✓ should #lineSegments(), #drawLine() (315ms)
    ✓ should throw error on too large precision
    ✓ should #connectedComponents() (628ms)
    ✓ should #distanceFunction() and #maxDynamicRange()
    ✓ should #fillBox() (362ms)
    ✓ should #drawBox() (388ms)
    ✓ should #drawImage()
    ✓ should #octreeColorQuant()
    ✓ should #medianCutQuant()
    ✓ should #threshold()
    ✓ should #histogram()
    ✓ should #projection()
    ✓ should #applyCurve() and #setMasked() (187ms)

  Tesseract
    ✓ should #clear()
    ✓ should #clearAdaptiveClassifier()
    ✓ should set #image to null
    ✓ should set #image
    ✓ should set/get variables
    ✓ should set/get a whitelist
    ✓ should #findRegions() (4471ms)
    ✓ should #findRegions(false) (1352ms)
    ✓ should #findTextLines() (4248ms)
    ✓ should #findTextLines(false) (1396ms)
    ✓ should #findParagraphs() (4432ms)
    ✓ should #findParagraphs(false) (1343ms)
    ✓ should #findWords() (3984ms)
    ✓ should #findWords(false) (1362ms)
    ✓ should #findSymbols() (4101ms)
    ✓ should #findSymbols(false) (1352ms)
    ✓ should #findText('plain') (3480ms)
    ✓ should #findText('plain', true) (3512ms)
    ✓ should #findText('unlv') (3818ms)
    ✓ should #findText('unlv', true) (3544ms)
    ✓ should #findText('hocr', 0) (3503ms)
    ✓ should #findText('box', 0) (3541ms)
    ✓ should generate hOCR without recognition (527ms)

  ZXing
    ✓ should have no #image set
    ✓ should set #image to null
    ✓ should have #formats set
    ✓ should have #tryHarder
    #findCode()
    ✓ should find nothing
node(58866,0x7fff7266f000) malloc: *** error for object 0x7fff50983a99: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
atdrago commented 8 years ago

Please consider merging this PR and republishing to NPM. Your package cannot be built on Mac OS X as is.

krithixy commented 7 years ago

@WolfgangFellger @rashfael Please consider merging this PR

rashfael commented 7 years ago

Neither @WolfgangFellger nor I are with creatale anymore, sorry.

thlorenz commented 7 years ago

@krithixy I merged @diegoperini's fixes (this PR) into my fork: https://github.com/thlorenz/ndv and published as ndv on npm, so now you can install a working version via npm install ndv.

I hope we can get the other PRs that are pending here merged there as well and thus keep it working on all platforms. Any help with that is appreciated.

diegoperini commented 7 years ago

@thlorenz You should consider editting the README as well as the repo description to indicate your fork has a purpose other than assuming ownership. You may add something like "A fork of node-dv with OS X build fix". 👍

thlorenz commented 7 years ago

@diegoperini it already provides that info as a github feature, i.e. look at the top of the repo it'll say where it was forked from. Additionally I hope at some point my changes will make it back here, but am not sure.