2

I must be missing something but I'm trying to use the Leptonica C library in Go using a C wrapper that was made for that purpose:

https://github.com/GeertJohan/go.leptonica/blob/master/leptonica.go

But I don't understand... it allows me to import files but then how do I actually invoke the Leptonica functions? (Specifically I want to detect the deskew of the image using Leptonica.)

I don't see any function in the Go wrapper that allows me to send a command like this. How do I talk to it?

Alasdair
  • 13,348
  • 18
  • 82
  • 138
  • 1
    It seems like this wrapper does not expose the complete API of leptonica. You might need to write your own. It isn't too difficult. – fuz Oct 02 '14 at 15:38
  • Well it must be something... if all it did was let you load images but do nothing with them then it would be useless for any purpose. – Alasdair Oct 02 '14 at 15:40
  • But a great place for you to start from. Its what pull requests were made for. – DanG Oct 02 '14 at 15:42

1 Answers1

1

go.leptonica simply hasn't implemented that. You'll have to call the C functions yourself.

Use leptonica.go as a starting point, and write your own wrapper.

JimB
  • 104,193
  • 13
  • 262
  • 255
  • I would *love* to be able to do that, think of all the C libraries I could use! Alas, I've never written C. Could you please point me in the right direction for how to do this? – Alasdair Oct 02 '14 at 15:41
  • That was surprisingly easy. Go makes me happy :) – Alasdair Oct 02 '14 at 16:21