Code Monkey home page Code Monkey logo

Comments (7)

cpwood avatar cpwood commented on August 15, 2024 1

@hschimke Thank you for all the suggestions. Happy to work on all of those; give me a few days and I'll come back to you. In the meantime, have a Happy New Year!

from rxing.

hschimke avatar hschimke commented on August 15, 2024 1

Looks ready for a PR! I didn't see anything looking through just now but I'll do a proper review on the PR.

from rxing.

hschimke avatar hschimke commented on August 15, 2024 1

Merged, it's been a pleasure working with you!

from rxing.

hschimke avatar hschimke commented on August 15, 2024

@cpwood I'm absolutely interested in bringing your fork into rxing. Telepen seems like a perfect addition.

I have a couple thoughts before we do a PR:

  • You have a TelepenCommon struct in src/oned/telepen_common.rs. The rust way to do this is likely with a module rather than a struct.

  • If possible I'd like a handful more test images, perhaps around 10.

  • Please add a unit test for the telepen checksum function in TelepenCommon

  • There are two variants of Telepen: alphanumeric and numeric. Numeric is actually just an interpretation of the ASCII alphanumeric data returned after interpreting the barcodes, so this is left as an exercise for the user, however I can provide code samples. As such, only alphanumeric is implemented.

    If you wanted to offer the ability to decode either based on expectation, you could add this through the DecodeHints enum. Not required, of course, just an option if you thought that the functionality was useful to include.

I think, given the content of this, I'd roll it up into the next release (v0.5). I have a change to the features list that I was planning to include in that release as well.

Thanks for your submission, I look forward to the PR.

from rxing.

cpwood avatar cpwood commented on August 15, 2024

@hschimke I've now done the changes you requested.

  1. telepen_common.rs is now a mod;
  2. There are now 12 test cases overall:
  • 5 alphanumeric tests
  • 7 numeric tests
  • Numeric decoding has been supported as you suggested, by introducing a hint.
  • The additional test imagery are real photos taken at my local library today, as opposed to computer-generated bitmaps.
  1. Unit tests now exist for the checksum function, and also for the alpha -> numeric and numeric -> alpha routines in there too.

All tests pass.

As per previous comments, it's the same code for alphanumeric and numeric, it's just there's a conversion from ASCII to numeric that happens after the barcode decoding is complete with numeric. In essence, therefore, the 7 numeric tests also test the alphanumeric functionality too.

Will leave it with you to review! Let me know if you need anything further?

from rxing.

cpwood avatar cpwood commented on August 15, 2024

Merged, it's been a pleasure working with you!

Likewise! I really appreciated the time you took to point me in the right direction! Looking forward to the 1.5 WASM build!

from rxing.

hschimke avatar hschimke commented on August 15, 2024

Built and published as v0.2.0.

I tested and verified that it is decoding Telepen with the demo site https://scan.rxing.org (which uses the latest version of the npm package)

from rxing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.