.task {
   let imageURL = Bundle.main.url(forResource: "magazinebar", withExtension: "png")
   if let imageURL = imageURL {
      do {
         var request = DetectBarcodesRequest()
         request.symbologies = [.codabar]

         let result = try await request.perform(on: imageURL)
         if let code = result.first {
            barcode = code.payloadString ?? "Not Found"
            codeType = "Type: \(code.symbology)"
         }
      } catch {
         print("Error performing the request: \(error)")
      }
   }
}