Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Ability to scan bar code when creating new coupon #17

Open
meichthys opened this issue Sep 30, 2022 · 3 comments
Open

Comments

@meichthys
Copy link

Currently we input the code manually. It would be nice to be able to scan the bar code using an image (or camera on mobile device).

@meichthys
Copy link
Author

One workaround i've found on iOS is:

  • Tap Code input field twice
  • Tap the Scan icon (only available on newer iphones)
  • Point camera at code number under the barcode if it exists
  • Tap insert when code is correctly displayed in the field

Downside of this method: it preserves spaces which coupon-store doesn't currently support/handle (#18 )

@phylor
Copy link
Contributor

phylor commented Oct 2, 2022

This is definitely a feature that would make the app easier to use. Your iOS workaround should work fine in the latest release.

Camera support would be great. Also uploading an image (scan or photo) would probably be useful as well.

Libraries to check out for reading barcodes:

@moongear
Copy link

moongear commented Feb 12, 2025

I, too, was thinking about this and may play around with it. A proof of concept, in part:

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Barcode Scanner</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/quagga/0.12.1/quagga.min.js"></script>
</head>
<body>
  <h1>Camera Barcode Scanner</h1>
  <div id="interactive" style="width: 100%; max-width: 640px; margin: auto;"></div>
  <p id="output">Scanned Barcode: <strong>No barcode scanned yet</strong></p>

  <script>
    // Configure QuaggaJS
    Quagga.init(
      {
        inputStream: {
          name: "Live",
          type: "LiveStream",
          target: document.querySelector("#interactive"),
        },
        decoder: {
          readers: ["code_128_reader", "ean_reader"], // Barcode formats to scan
        },
      },
      (err) => {
        if (err) {
          console.error("Error initializing Quagga:", err);
          return;
        }
        Quagga.start(); // Start live video scanning
      }
    );

    // Listen for detected barcodes
    Quagga.onDetected((data) => {
      console.log("Detected barcode:", data.codeResult.code);
      document.getElementById("output").innerHTML = `Scanned Barcode: <strong>${data.codeResult.code}</strong>`;
      Quagga.stop(); // Stop scanning after a successful read (optional)
    });
  </script>
</body>
</html>

And, not to creep into this request, but an image upload for a logo would be nice, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants