java.lang.Object
de.iip_ecosphere.platform.kiServices.functions.images.QRCodeScanner

public class QRCodeScanner extends Object
Offers the functionality of reading in qr codes.
Author:
Alexander Weber, SSE
  • Field Details

    • resultScript

      private static String resultScript
    • qrScriptOwner

      private static de.iip_ecosphere.platform.services.environment.ProcessSupport.ScriptOwner qrScriptOwner
      will probably not work on windows!(Set files location for windows, might be changed) Maybe different way to enable debug information instead of deleting/adding .withProcessCustomizer(ProcessSupport.INHERIT_IO);.
  • Constructor Details

    • QRCodeScanner

      public QRCodeScanner()
  • Method Details

    • readQRCode

      public static String readQRCode(String b64image) throws IOException
      Enables the QR code detection for base64 encoded images.
      Parameters:
      b64image - Image as base 64 encoded string.
      Returns:
      the result of the QR scan.
      Throws:
      IOException - When the conversion from String to image fails.
    • readQRCode

      public static String readQRCode(BufferedImage bufferedImage)
      Detects a QR code on bufferdImages. Source: https://simplesolution.dev/java-read-qr-code-from-image-file-base64-zxing/
      Parameters:
      bufferedImage - a BufferdImage to read a QR code from.
      Returns:
      The content of the QR code as a String. If nothing could be detected the String will be empty.
    • pythonFallbackQRDetection

      public static String pythonFallbackQRDetection(String b64Image)
      Call for python fallback script. Shall retry the detection!
      Parameters:
      b64Image - The image.
      Returns:
      The contents of the QR code as a String.