Giter Club home page Giter Club logo

paycards_ios's People

Contributors

ef1rspb avatar vitkuzmenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paycards_ios's Issues

Modification rights

I have a confusion about modification rights of this library. We have a commercial project, currently is being developed with Flutter.

I am intended to modify this library for our project. So far, I can see it runs recognition algorithm on device. But it shares the results with PayCards. My company doesn't want this.

So, I'm planning to modify this library (I guess "dramatically"). It will work with Flutter. And probably we will only use the algorithm but nothing else in the library. Am I allowed to do this? I know it's licensed with MIT license but the Term of Services are confusing me. I would appreciate it if you can clarify this for me.

App is getting crashed while scanning in IOS

Can you please check this issue with PayCards_IOS sdk . I am getting this crash logs from Crashlytics.

Crashed: com.sunsetlakesoftware.GPUImage.openGLESContextQueue
0 libsystem_platform.dylib 0x182496a20 _platform_memmove + 80
1 PayCardsRecognizer 0x103707dc4 CFrameStorage::SetRawY(void const*, void const*, std::__1::vector<ParametricLine, std::__1::allocator > const&, PayCardsRecognizerOrientation) + 40
2 PayCardsRecognizer 0x103707dc4 CFrameStorage::SetRawY(void const*, void const*, std::__1::vector<ParametricLine, std::__1::allocator > const&, PayCardsRecognizerOrientation) + 40
3 PayCardsRecognizer 0x1035d6d28 CRecognitionCore::ProcessFrame(DetectedLineFlags&, void*, void*, unsigned long, unsigned long) + 372
4 PayCardsRecognizer 0x1035df0f0 -[PayCardsRecognizer willOutputSampleBuffer:] + 136
5 PayCardsRecognizer 0x103636de0 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 104
6 libdispatch.dylib 0x18216cb24 _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x18216cae4 _dispatch_client_callout + 16
8 libdispatch.dylib 0x182176a38 _dispatch_queue_serial_drain$VARIANT$mp + 608
9 libdispatch.dylib 0x182177380 _dispatch_queue_invoke$VARIANT$mp + 336
10 libdispatch.dylib 0x182177d4c _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
11 libdispatch.dylib 0x18218011c _dispatch_workloop_worker_thread$VARIANT$mp + 668
12 libsystem_pthread.dylib 0x18249fe70 _pthread_wqthread + 860
13 libsystem_pthread.dylib 0x18249fb08 start_wqthread + 4

Card Image Not Coming

Hello,
I was trying the SDK and it’s working perfect to return card number and details but card image always coming nil.

Cocoapods Install

Had to use

pod 'PayCardsRecognizer', :git => 'https://github.com/faceterteam/PayCards_iOS.git'

because

pod 'PayCardsRecognizer' always fails

screen shot 2017-09-06 at 5 47 55 pm

Delay calling delegate function of didRecognize result

Once recognized card number takes nearly 5sec in navigating to next screen.It should navigate immediately once card gets recognized.

How could I improve the performance of the scanning?

Please help with this issue,
Thanks

Supporting Non Embossed Cards

Hi Guys, most new Visa/Mastercard cards these days are not embossed, and the number is usually on the back of the card. I was wondering whether you guys were going to start supporting cards with the number printed on them and not embossed. 4 out of 5 of my cards are not embossed and your scanner only seems to work on the one embossed one.

Issue with iPhone X/XR-XS/11-11 Pro Max (iOS 13.3)

iOS: 13.3
PayCards version: 1.1.7 (Installed using Cocoapods)

Issue Description: When the card is scanned, the camera does not detect the left and right edges of the credit card. However, it normally recognizes the upper and lower bounds. This problem is only observed on iPhone X, XR/XS, 11-11 Pro Max.

Everything works fine on iPhone 6S/SE

Founded similar problem

import Foundation
import PayCardsRecognizer

protocol CardRecognizerDelegate: class {
    func didReceivedCreditCardData(cardNumber: String,
                     cardholderName: String,
                     monthExp: String,
                     yearExp: String)
}

class CardRecognizer {

    var recognizer: PayCardsRecognizer!
    weak var delegate: CardRecognizerDelegate!
  
    init(forView view: UIView) {
        recognizer = PayCardsRecognizer(delegate: self,
                                        resultMode: .async,
                                        container: view,
                                        frameColor: .green)
    }
    
}

extension CardRecognizer: PayCardsRecognizerPlatformDelegate {
    func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {
        self.delegate.didReceivedCreditCardData(cardNumber: result.recognizedNumber ?? "",
                                  cardholderName: result.recognizedHolderName ?? "",
                                  monthExp: result.recognizedExpireDateMonth ?? "",
                                  yearExp: result.recognizedExpireDateYear ?? "")
    }
}

How to remove "powered by pay.cards" from Camera

Hi, does anyone know how i can remove this button "powered by pay.cards" from camera please.Can i do it by using the pod. If there is another way, how can i remove it. It works when i remove it from there other 'PayCards_iOS_Source' but not this repo. Thanks.

Карта

Хочу пользоваться сканированием Карты через приложение pay.kards

Unsupported architecture i386, x86_64

When submit application with PayCards framework, iTunes return an error about unsupported architectures i386 and x86_64

Quick fix

Open terminal and execute following commands
lipo -remove x86_64 /YOUR_PATH/PayCardsRecognizer.framework/PayCardsRecognizer -o /YOUR_PATH/PayCardsRecognizer.framework/PayCardsRecognizer

lipo -remove i386 /YOUR_PATH/PayCardsRecognizer.framework/PayCardsRecognizer -o /YOUR_PATH/PayCardsRecognizer.framework/PayCardsRecognizer

Crash iOS12 & iOS13 when scanning again

Hello,
after update to latest version of the framework, the demo app is crashing under iOS 12 & 13
steps to reproduce :

  • scan a card
  • display infos
  • going back
  • scan again
  • repeat until it crashes

the error is located in "FrameStorage.cpp" at "SetRawY" function, see the screenshots :
Capture d’écran 2019-10-11 à 10 28 27
Capture d’écran 2019-10-11 à 10 29 38

Can you help me with this please ?

Failed to verify bitcode

Failed to verify bitcode in PayCardsRecognizer.framework/PayCardsRecognizer:
error: Linker option verification failed for bundle /var/folders/nf/21w8cbhs65g_25y7xxws6fz00000gn/T/PayCardsRecognizergEAS8W/PayCardsRecognizer.armv7.xar (unrecognized arguments: -platform_version iOS 8.0.0 13.2.0)

.grabCardImage mode: result.image returns nil

i just want to grag image but result returns nil where is problem can u help me?

recognizer = PayCardsRecognizer(delegate: self, recognizerMode: .grabCardImage, resultMode: .async, container: self.view, frameColor: .green)

func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {
    
    print(result.image)
}

App is getting crashed after scanning card in iOS 11

Here is the crash logs from Crashlytics...Can you please help in resolving this issue

#9. Crashed: Thread
0 PayCardsRecognizer 0x100e3277c CNumberRecognizer::ValidateNumber(std::__1::shared_ptr const&) + 336
1 PayCardsRecognizer 0x100e31d84 CNumberRecognizer::ProcessMatrixFinal(cv::Mat&, std::_1::vector<cv::Point, std::1::allocator<cv::Point > > const&, std::1::shared_ptr const&, cv::Point, cv::Rect&) + 2176
2 PayCardsRecognizer 0x100e3059c CNumberRecognizer::Process(cv::Mat&, cv::Rect
&) + 1272
3 PayCardsRecognizer 0x100beb0a4 CRecognitionCore::RecognizeNumber() + 312
4 PayCardsRecognizer 0x100beabf8 CRecognitionCore::Recognize() + 152
5 PayCardsRecognizer 0x100beaa88 CRecognitionCore::ProcessFrameThreaded() + 152
6 PayCardsRecognizer 0x100beeb20 CRecognitionCore::ProcessFrame(DetectedLineFlags&, void*, void*, unsigned long, unsigned long)::$_0::operator()() const + 28
7 PayCardsRecognizer 0x100bee904 void* std::__1::__thread_proxy<std::__1::tuple<CRecognitionCore::ProcessFrame(DetectedLineFlags&, void*, void*, unsigned long, unsigned long)::$_0> >(void*) + 276
8 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
9 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
10 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

--

#0. com.apple.main-thread
0 libsystem_kernel.dylib 0x18c2ff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x18c2ff09c mach_msg + 72
2 CoreFoundation 0x18d2d0e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x18d2ceae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x18d1feda4 CFRunLoopRunSpecific + 424
5 GraphicsServices 0x18ec69074 GSEventRunModal + 100
6 UIKit 0x1934b9c9c UIApplicationMain + 208
7 iconGo 0x10018570c main (main.m:14)
8 libdyld.dylib 0x18c20d59c start + 4

#1. Thread
0 libsystem_kernel.dylib 0x18c31da88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18c3e31a4 _pthread_wqthread + 1260
2 libsystem_pthread.dylib 0x18c3e2cac start_wqthread + 4

#2. com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x18c2ff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x18c2ff09c mach_msg + 72
2 CoreFoundation 0x18d2d0e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x18d2ceae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x18d1feda4 CFRunLoopRunSpecific + 424
5 Foundation 0x18dd19db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x18dd3ab84 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x193e43830 -[UIEventFetcher threadMain] + 136
8 Foundation 0x18de17318 NSThread__start + 996
9 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
10 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
11 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

#3. Thread
0 libsystem_kernel.dylib 0x18c31da88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18c3e31a4 _pthread_wqthread + 1260
2 libsystem_pthread.dylib 0x18c3e2cac start_wqthread + 4

#4. com.twitter.crashlytics.ios.MachExceptionServer
0 iconGo 0x1001f90e8 CLSProcessRecordAllThreads + 4296773864
1 iconGo 0x1001f90e8 CLSProcessRecordAllThreads + 4296773864
2 iconGo 0x1001f8fa4 CLSProcessRecordAllThreads + 4296773540
3 iconGo 0x1001e8d70 CLSHandler + 4296707440
4 iconGo 0x1001e3d84 CLSMachExceptionServer + 4296686980
5 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
6 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
7 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

#5. com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x18c2ff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x18c2ff09c mach_msg + 72
2 CoreFoundation 0x18d2d0e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x18d2ceae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x18d1feda4 CFRunLoopRunSpecific + 424
5 CFNetwork 0x18da0bdf4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6 Foundation 0x18de17318 NSThread__start + 996
7 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
8 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
9 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

#6. com.apple.CoreMotion.MotionThread
0 libsystem_kernel.dylib 0x18c2ff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x18c2ff09c mach_msg + 72
2 CoreFoundation 0x18d2d0e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x18d2ceae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x18d1feda4 CFRunLoopRunSpecific + 424
5 CoreFoundation 0x18d24b9c0 CFRunLoopRun + 112
6 CoreMotion 0x194357fdc (null) + 203104
7 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
8 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
9 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

#7. Thread
0 libsystem_kernel.dylib 0x18c31da88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18c3e2fd0 _pthread_wqthread + 792
2 libsystem_pthread.dylib 0x18c3e2cac start_wqthread + 4

#8. Thread
0 libsystem_kernel.dylib 0x18c31da88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18c3e31a4 _pthread_wqthread + 1260
2 libsystem_pthread.dylib 0x18c3e2cac start_wqthread + 4

#9. Crashed: Thread
0 PayCardsRecognizer 0x100e3277c CNumberRecognizer::ValidateNumber(std::__1::shared_ptr const&) + 336
1 PayCardsRecognizer 0x100e31d84 CNumberRecognizer::ProcessMatrixFinal(cv::Mat&, std::_1::vector<cv::Point, std::1::allocator<cv::Point > > const&, std::1::shared_ptr const&, cv::Point, cv::Rect&) + 2176
2 PayCardsRecognizer 0x100e3059c CNumberRecognizer::Process(cv::Mat&, cv::Rect
&) + 1272
3 PayCardsRecognizer 0x100beb0a4 CRecognitionCore::RecognizeNumber() + 312
4 PayCardsRecognizer 0x100beabf8 CRecognitionCore::Recognize() + 152
5 PayCardsRecognizer 0x100beaa88 CRecognitionCore::ProcessFrameThreaded() + 152
6 PayCardsRecognizer 0x100beeb20 CRecognitionCore::ProcessFrame(DetectedLineFlags&, void*, void*, unsigned long, unsigned long)::$_0::operator()() const + 28
7 PayCardsRecognizer 0x100bee904 void* std::__1::__thread_proxy<std::__1::tuple<CRecognitionCore::ProcessFrame(DetectedLineFlags&, void*, void*, unsigned long, unsigned long)::$_0> >(void*) + 276
8 libsystem_pthread.dylib 0x18c3e568c _pthread_body + 240
9 libsystem_pthread.dylib 0x18c3e559c _pthread_body + 282
10 libsystem_pthread.dylib 0x18c3e2cb4 thread_start + 4

#10. Thread
0 libsystem_kernel.dylib 0x18c31da88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18c3e2fd0 _pthread_wqthread + 792
2 libsystem_pthread.dylib 0x18c3e2cac start_wqthread + 4

tinkoff.ru

import Foundation
import PayCardsRecognizer

protocol CardRecognizerDelegate: class {
func didReceivedCreditCardData(cardNumber: String,
cardholderName: String,
monthExp: String,
yearExp: String)
}

class CardRecognizer {

var recognizer: PayCardsRecognizer!
weak var delegate: CardRecognizerDelegate!

init(forView view: UIView) {
    recognizer = PayCardsRecognizer(delegate: self,
                                    resultMode: .async,
                                    container: view,
                                    frameColor: .green)
}

}

extension CardRecognizer: PayCardsRecognizerPlatformDelegate {
func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {
self.delegate.didReceivedCreditCardData(cardNumber: result.recognizedNumber ?? "",
cardholderName: result.recognizedHolderName ?? "",
monthExp: result.recognizedExpireDateMonth ?? "",
yearExp: result.recognizedExpireDateYear ?? "")

Framework build for deployment target 10.3

dyld: Symbol not found: _NSDictionary0
Referenced from: /private/var/mobile/Containers/Bundle/Application/35E3D01C-09D3-40D1-A14A-F41B1C5DF813/RoboForm.app/Frameworks/PayCardsRecognizer.framework/PayCardsRecognizer (which was built for iOS 10.3)
Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /private/var/mobile/Containers/Bundle/Application/35E3D01C-09D3-40D1-A14A-F41B1C5DF813/RoboForm.app/Frameworks/PayCardsRecognizer.framework/PayCardsRecognizer

Number:(null), Rect:{{0, 0}, {0, 0}} Name:(null), Expiration:(null)/(null) Image:(null)

I am using PayCardsRecognizer framework in my app, I am getting bleow response on this(“func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {}”) method:

Number:(null), Rect:{{0, 0}, {0, 0}} Name:(null), Expiration:(null)/(null) Image:(null)

// here is my Setup for recognizer:
recognizer = PayCardsRecognizer(delegate: self, recognizerMode: .grabCardImage, resultMode: .async, container: self.view, frameColor: .red)

I want capture image on this response.
Please help me.

iOS 13 support

Hi,
The scanner is not working on iOS, I don't see any logs and really don't have any clue of what may be the issue, one thing that is visible is that the colored frames for the card framing show up in the top and bottom before placing any rectangular object in from of the camera, I'm trying to debug the issue my self but i haven't been able to compile to framework source.
Any pointer would be highly appreciated.
The company I work for may provide a payment for support on this issue.
Thank you

How do I scan custom card?

I have specific cards in my country it looks like as MasterCard or VisaCard but it not scanning at all.
Is there any options that I can scan custom card?

Not working on ios 13

version installed: 1.1.6
ios version: 13
Hello, so I am working in application with flutter, I am using a channel to contact this library with the native code. I managed to communicate effectively with the Android SDK but in the case of this ios counterpart I haven't managed to use it, as I invoke the view controller, the camera scanner appears but It doesn't read the card.

This is my code, you'll notice that is the same as the sample.

import UIKit

import PayCardsRecognizer

class ReadCardController: UIViewController, PayCardsRecognizerPlatformDelegate {
    
    var recognizer: PayCardsRecognizer!

    override func viewDidLoad() {
        super.viewDidLoad()
        recognizer = PayCardsRecognizer(
            delegate: self,
            resultMode: .sync,
            container: self.view,
            frameColor: .green
        )
        // Do any additional setup after loading the view.
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        recognizer.startCamera()
    }
        
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        
        recognizer.stopCamera()
        
    }
 
   // never gets called
    func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {
        print("this the result: \(result)")
    }
    
    // never gets called
    func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didCancel result: PayCardsRecognizerResult?) {
     
        print("did cancel function :c")
    }
    
    
}

Orientation Issue

In pay.cards when we use landscape mode its not working in both case.

-[PayCardsRecognizer willOutputSampleBuffer:] + 140

Using below version

  • PayCardsRecognizer (1.1.7)

Crashed: com.sunsetlakesoftware.GPUImage.openGLESContextQueue
0 libobjc.A.dylib 0x18f717530 objc_msgSend + 16
1 PayCardsRecognizer 0x10522c3c8 -[PayCardsRecognizer willOutputSampleBuffer:] + 140
2 PayCardsRecognizer 0x105283a38 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 100
3 libdispatch.dylib 0x18ff64a38 _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x18ff657d4 _dispatch_client_callout + 16
5 libdispatch.dylib 0x18ff0e324 _dispatch_lane_serial_drain$VARIANT$mp + 592
6 libdispatch.dylib 0x18ff0ee40 _dispatch_lane_invoke$VARIANT$mp + 428
7 libdispatch.dylib 0x18ff174ac _dispatch_workloop_worker_thread + 596
8 libsystem_pthread.dylib 0x190146114 _pthread_wqthread + 304
9 libsystem_pthread.dylib 0x190148cd4 start_wqthread + 4

PayCardsRecognizerDataMode options

is there any way to add the ability to add multiple recognizers data modes, per example in my case would be very useful if I could do something like this:

PayCardsRecognizer( delegate: self, resultModes: [.name, .number], resultMode: .async, container: view)

Invalid Image bits Warnings

PayCards[865:113013] [Unknown process name] CGImageCreate: invalid image bits/component: 8 bits/pixel 8 alpha info = kCGImageAlphaNoneSkipLast

My Logs are filled with logs like these. I am getting the card number though

invalid image/bits component

Gets to the point of recognizing the card and displaying overlay text, then the camera stops here.

2019-07-04 20:28:44.873492-0600 AppName[504:69341] [Unknown process name] CGImageCreate: invalid image bits/component: 8 bits/pixel 8 alpha info = kCGImageAlphaNoneSkipLast
2019-07-04 20:28:44.905323-0600 AppName[504:69341] [Unknown process name] CGImageCreate: invalid image bits/component: 8 bits/pixel 24 alpha info = kCGImageAlphaNoneSkipLast
2019-07-04 20:28:45.096340-0600 AppName[504:69341] [Unknown process name] CGImageCreate: invalid image bits/component: 8 bits/pixel 8 alpha info = kCGImageAlphaNoneSkipLast

UI API called from background thread warnings

I've found that if you use the PayCardsRecognizer and set up the UI programmatically, you get "UI API called on a background thread" warnings intermittently, probably like 1/5 times, when presenting the view controller.

The warning stack trace is:

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 20583, TID: 4297841, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4   PayCardsRecognizer                  0x0000000108781a50 -[GPUImageView createDisplayFramebuffer] + 188
5   PayCardsRecognizer                  0x0000000108781be4 -[GPUImageView setDisplayFramebuffer] + 48
6   PayCardsRecognizer                  0x0000000108781f50 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7   PayCardsRecognizer                  0x000000010875633c runSynchronouslyOnVideoProcessingQueue + 100
8   PayCardsRecognizer                  0x0000000108781efc -[GPUImageView newFrameReadyAtTime:atIndex:] + 68
9   PayCardsRecognizer                  0x00000001086cafec -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 960
10  PayCardsRecognizer                  0x00000001086cb584 -[GPUImageVideoCamera processVideoSampleBuffer:] + 1316
11  PayCardsRecognizer                  0x00000001086cba50 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 124
12  libdispatch.dylib                   0x000000010a11a338 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a11b730 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a122740 _dispatch_lane_serial_drain + 744
15  libdispatch.dylib                   0x000000010a1232e0 _dispatch_lane_invoke + 444
16  libdispatch.dylib                   0x000000010a12e6c4 _dispatch_workloop_worker_thread + 1304
17  libsystem_pthread.dylib             0x00000001b3638b74 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001b363b740 start_wqthread + 8
2020-09-17 10:00:37.740128+1000 MyProjectName[20583:4297841] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 20583, TID: 4297841, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4   PayCardsRecognizer                  0x0000000108781a50 -[GPUImageView createDisplayFramebuffer] + 188
5   PayCardsRecognizer                  0x0000000108781be4 -[GPUImageView setDisplayFramebuffer] + 48
6   PayCardsRecognizer                  0x0000000108781f50 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7   PayCardsRecognizer                  0x000000010875633c runSynchronouslyOnVideoProcessingQueue + 100
8   PayCardsRecognizer                  0x0000000108781efc -[GPUImageView newFrameReadyAtTime:atIndex:] + 68
9   PayCardsRecognizer                  0x00000001086cafec -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 960
10  PayCardsRecognizer                  0x00000001086cb584 -[GPUImageVideoCamera processVideoSampleBuffer:] + 1316
11  PayCardsRecognizer                  0x00000001086cba50 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 124
12  libdispatch.dylib                   0x000000010a11a338 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a11b730 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a122740 _dispatch_lane_serial_drain + 744
15  libdispatch.dylib                   0x000000010a1232e0 _dispatch_lane_invoke + 444
16  libdispatch.dylib                   0x000000010a12e6c4 _dispatch_workloop_worker_thread + 1304
17  libsystem_pthread.dylib             0x00000001b3638b74 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001b363b740 start_wqthread + 8
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 20583, TID: 4297841, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4   PayCardsRecognizer                  0x0000000108781b0c -[GPUImageView createDisplayFramebuffer] + 376
5   PayCardsRecognizer                  0x0000000108781be4 -[GPUImageView setDisplayFramebuffer] + 48
6   PayCardsRecognizer                  0x0000000108781f50 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7   PayCardsRecognizer                  0x000000010875633c runSynchronouslyOnVideoProcessingQueue + 100
8   PayCardsRecognizer                  0x0000000108781efc -[GPUImageView newFrameReadyAtTime:atIndex:] + 68
9   PayCardsRecognizer                  0x00000001086cafec -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 960
10  PayCardsRecognizer                  0x00000001086cb584 -[GPUImageVideoCamera processVideoSampleBuffer:] + 1316
11  PayCardsRecognizer                  0x00000001086cba50 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 124
12  libdispatch.dylib                   0x000000010a11a338 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a11b730 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a122740 _dispatch_lane_serial_drain + 744
15  libdispatch.dylib                   0x000000010a1232e0 _dispatch_lane_invoke + 444
16  libdispatch.dylib                   0x000000010a12e6c4 _dispatch_workloop_worker_thread + 1304
17  libsystem_pthread.dylib             0x00000001b3638b74 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001b363b740 start_wqthread + 8
2020-09-17 10:00:46.642641+1000 MyProjectName[20583:4297841] [reports] Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 20583, TID: 4297841, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4   PayCardsRecognizer                  0x0000000108781b0c -[GPUImageView createDisplayFramebuffer] + 376
5   PayCardsRecognizer                  0x0000000108781be4 -[GPUImageView setDisplayFramebuffer] + 48
6   PayCardsRecognizer                  0x0000000108781f50 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7   PayCardsRecognizer                  0x000000010875633c runSynchronouslyOnVideoProcessingQueue + 100
8   PayCardsRecognizer                  0x0000000108781efc -[GPUImageView newFrameReadyAtTime:atIndex:] + 68
9   PayCardsRecognizer                  0x00000001086cafec -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 960
10  PayCardsRecognizer                  0x00000001086cb584 -[GPUImageVideoCamera processVideoSampleBuffer:] + 1316
11  PayCardsRecognizer                  0x00000001086cba50 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 124
12  libdispatch.dylib                   0x000000010a11a338 _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010a11b730 _dispatch_client_callout + 16
14  libdispatch.dylib                   0x000000010a122740 _dispatch_lane_serial_drain + 744
15  libdispatch.dylib                   0x000000010a1232e0 _dispatch_lane_invoke + 444
16  libdispatch.dylib                   0x000000010a12e6c4 _dispatch_workloop_worker_thread + 1304
17  libsystem_pthread.dylib             0x00000001b3638b74 _pthread_wqthread + 272
18  libsystem_pthread.dylib             0x00000001b363b740 start_wqthread + 8

I'm using Cocoapods to install the framework, and interestingly I'm not able to reproduce this issue if I use a storyboard to generate the UI. I noticed that your example project doesn't have this issue, and also uses a storyboard, which appears to work there too. If you want to try reproduce this, the view controller I'm using which runs into the issue is:

import PayCardsRecognizer
import UIKit

protocol CreditCardScanPresenting {
    func scanned(name: String?, number: String?, expiryMonth: String?, expiryYear: String?)
}

final class CreditCardScanViewController: UIViewController {
    private let presenter: CreditCardScanPresenting
    private let cancelBag = CancelBag()

    private let cardScanContainer = UIView()
    private let labelContainer = UIView()
    private let titleLabel = UILabel()
    private let subtitleLabel = UILabel()

    private lazy var recognizer = PayCardsRecognizer(
        delegate: self,
        resultMode: .async,
        container: cardScanContainer,
        frameColor: .theme(.primaryColor)
    )

    init(presenter: CreditCardScanPresenting) {
        self.presenter = presenter
        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder: NSCoder) {
        fatalError("Init with coder not supported.")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        prepareLayout()
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        navigationController?.navigationBar.shadowImage = UIImage()
        recognizer.startCamera()
    }

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)

        recognizer.stopCamera()
    }
}

private extension CreditCardScanViewController {
    func prepareLayout() {
        prepareNavigationBar()
        prepareCardScanContainer()
        prepareTitleLabel()
        prepareSubtitleLabel()
        prepareLabelContainer()
    }

    private func prepareNavigationBar() {
        navigationItem.largeTitleDisplayMode = .never
        navigationItem.leftBarButtonItem = {
            let item = UIBarButtonItem(image: .asset(.closeIcon), style: .plain)
            item.tintColor = .theme(.primaryColor)
            item.tapPublisher
                .sink { [weak self] in
                    self?.dismiss(animated: true, completion: nil)
                }
                .cancelledBy(cancelBag)
            return item
        }()
    }

    private func prepareCardScanContainer() {
        view.addSubview(cardScanContainer)

        cardScanContainer.constrain([.leading, .trailing], to: view)
        cardScanContainer.topAnchor
            .constraint(equalTo: view.safeAreaLayoutGuide.topAnchor)
            .activate()
    }

    private func prepareTitleLabel() {
        titleLabel.text = LocalizationKey.creditCardScanTitle.localized()
        titleLabel.font = .theme(.contentTitle)
        titleLabel.numberOfLines = 0
        titleLabel.textAlignment = .center

        labelContainer.addSubview(titleLabel)

        titleLabel.constrain(
            [.leading, .trailing, .top],
            to: labelContainer,
            constants: [
                .top: .contentPadding,
                .leading: .contentPadding,
                .trailing: -.contentPadding
            ]
        )
    }

    private func prepareSubtitleLabel() {
        subtitleLabel.text = LocalizationKey.creditCardScanSubtitle.localized()
        subtitleLabel.font = .theme(.contentValue)
        subtitleLabel.numberOfLines = 0
        subtitleLabel.textAlignment = .center

        labelContainer.addSubview(subtitleLabel)

        subtitleLabel.constrain(
            [.leading, .trailing, .bottom],
            to: labelContainer,
            constants: [
                .bottom: -.contentPadding,
                .leading: .contentPadding,
                .trailing: -.contentPadding
            ]
        )
        subtitleLabel.topAnchor
            .constraint(equalTo: titleLabel.bottomAnchor, constant: 8)
            .activate()
    }

    private func prepareLabelContainer() {
        view.addSubview(labelContainer)

        labelContainer.constrain([.leading, .trailing, .bottom], to: view)
        labelContainer.topAnchor
            .constraint(equalTo: cardScanContainer.bottomAnchor, constant: 0)
            .activate()
    }
}

extension CreditCardScanViewController: PayCardsRecognizerPlatformDelegate {
    func payCardsRecognizer(_ payCardsRecognizer: PayCardsRecognizer, didRecognize result: PayCardsRecognizerResult) {
        presenter.scanned(
            name: result.recognizedHolderName,
            number: result.recognizedNumber,
            expiryMonth: result.recognizedExpireDateMonth,
            expiryYear: result.recognizedExpireDateYear
        )
    }
}

There's a few custom extensions used there for constraints, but you get the general idea.

I did some Googling too and it looks like a similar issue is appearing here:
BradLarson/GPUImage#2512

I'm guessing from the stack trace you guys use the GPUImage library, and might find that useful, I could be misinterpreting it though.

Good luck, and thank you for an awesome card scanning framework!

Raw image in color

Hello I am new in Objective C programming and would like to retrieve the raw image in color.
If I use the result.image i get a grayscale image. The idea is that if I cannot get the card data at least have a picture of the card. Is this possible?

Thanks in advance
Nico

No support for landscape mode

Have layout for card frame but no rotation updates for video session.
As a result, there is no scanning capability

App is getting crashed on click of powered by text?

Hi Team,

As mentioned in title, my app getting crash on click of "Powered by pay.cards" text on bottom.

I check the cause of this crash,

"-[UIApplication openURL:options:completionHandler:]: unrecognized selector sent to instance 0x12fea56c0"

Any solution?

Thanks!

Disable log + Warning Threads?

Hi,

1/ There are 2 warnings (UI API called from background thread Group):

  • runtime: UI API called from background thread: -[UIView layer] must be used from main thread only -> #0 0x00000001036df2d3 in -[GPUImageView createDisplayFramebuffer] ()
  • runtime: UI API called from background thread: -[UIView bounds] must be used from main thread
    only -> #0 0x00000001036df38f in -[GPUImageView createDisplayFramebuffer] ()

2/ It's possible disable logs ?

Thanks

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 10160, TID: 3879908, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 PayCardsRecognizer 0x00000001058732d4 -[GPUImageView createDisplayFramebuffer] + 188
5 PayCardsRecognizer 0x0000000105873468 -[GPUImageView setDisplayFramebuffer] + 48
6 PayCardsRecognizer 0x0000000105873814 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7 PayCardsRecognizer 0x0000000105844ac8 runSynchronouslyOnVideoProcessingQueue + 100
8 PayCardsRecognizer 0x00000001058737b8 -[GPUImageView newFrameReadyAtTime:atIndex:] + 76
9 PayCardsRecognizer 0x00000001057b6368 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 976
10 PayCardsRecognizer 0x00000001057b692c -[GPUImageVideoCamera processVideoSampleBuffer:] + 1360
11 PayCardsRecognizer 0x00000001057b6e00 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 136
12 libdispatch.dylib 0x0000000108dc52cc _dispatch_call_block_and_release + 24
13 libdispatch.dylib 0x0000000108dc528c _dispatch_client_callout + 16
14 libdispatch.dylib 0x0000000108dd3f80 _dispatch_queue_serial_drain + 696
15 libdispatch.dylib 0x0000000108dc87ec _dispatch_queue_invoke + 332
16 libdispatch.dylib 0x0000000108dd4f6c _dispatch_root_queue_drain_deferred_wlh + 428
17 libdispatch.dylib 0x0000000108ddc020 _dispatch_workloop_worker_thread + 652
18 libsystem_pthread.dylib 0x0000000183a2af1c _pthread_wqthread + 932
19 libsystem_pthread.dylib 0x0000000183a2ab6c start_wqthread + 4

Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 10160, TID: 3879908, Thread name: (none), Queue name: com.sunsetlakesoftware.GPUImage.openGLESContextQueue, QoS: 0
Backtrace:
4 PayCardsRecognizer 0x0000000105873390 -[GPUImageView createDisplayFramebuffer] + 376
5 PayCardsRecognizer 0x0000000105873468 -[GPUImageView setDisplayFramebuffer] + 48
6 PayCardsRecognizer 0x0000000105873814 __44-[GPUImageView newFrameReadyAtTime:atIndex:]_block_invoke + 72
7 PayCardsRecognizer 0x0000000105844ac8 runSynchronouslyOnVideoProcessingQueue + 100
8 PayCardsRecognizer 0x00000001058737b8 -[GPUImageView newFrameReadyAtTime:atIndex:] + 76
9 PayCardsRecognizer 0x00000001057b6368 -[GPUImageVideoCamera updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] + 976
10 PayCardsRecognizer 0x00000001057b692c -[GPUImageVideoCamera processVideoSampleBuffer:] + 1360
11 PayCardsRecognizer 0x00000001057b6e00 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke + 136
12 libdispatch.dylib 0x0000000108dc52cc _dispatch_call_block_and_release + 24
13 libdispatch.dylib 0x0000000108dc528c _dispatch_client_callout + 16
14 libdispatch.dylib 0x0000000108dd3f80 _dispatch_queue_serial_drain + 696
15 libdispatch.dylib 0x0000000108dc87ec _dispatch_queue_invoke + 332
16 libdispatch.dylib 0x0000000108dd4f6c _dispatch_root_queue_drain_deferred_wlh + 428
17 libdispatch.dylib 0x0000000108ddc020 _dispatch_workloop_worker_thread + 652
18 libsystem_pthread.dylib 0x0000000183a2af1c _pthread_wqthread + 932
19 libsystem_pthread.dylib 0x0000000183a2ab6c start_wqthread + 4

Customize

Can I change color for scan's view corners of the frames ?

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.