Skip to content

Conversation

@msmuenchen
Copy link
Contributor

@msmuenchen msmuenchen commented Jan 27, 2024

This PR reworks LeptonicaFrameConverter#convert(Frame) to be able to convert b/w and RGB Frame instances to Leptonica PIX, no matter their stride size. Original bug reported in #1115.

It ships with a rough unit test against a few example images that were manually verified to be known-good.

Notes:

  • Unfortunately I had to drop big-endian support entirely as I lack a machine to test that.
  • I didn't touch the reverse function at all, maybe I'll do it when I have a bit of spare time but no promises.
  • I removed BytePointer frameData, pixData; ByteBuffer frameBuffer, pixBuffer; out of the equation entirely. I assume these were originally used for the byte-order conversion but as that's gone there is no reason to keep the image data around in any buffers where it might leak.

@saudet
Copy link
Member

saudet commented Jan 27, 2024

Add new tests under platform/src/test, not src/test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants