phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.42k forks source link

PDF 417 not work with binary encoded at iphone #519

Closed jasj closed 7 years ago

jasj commented 7 years ago

Expected Behaviour

At iphone must to decode the binary code as is do it on android

Actual Behaviour

Android decode a lot of data but ios just the first few chars, when is binnary data(probably found some ends chars)

Reproduce Scenario (including but not limited to)

try to can costarican cardId as it: cedulashort

Steps to Reproduce

scan code on android, then on iphone, first characters are equal in both operative systems but iphone has less length, in the picture bellow just 8 chats vs more then 100 with others card id even just 1 char

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 10

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

no problem on androin

Cordova CLI version and cordova platform version

PhoneGap (iOS / Android / Windows) cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)

Plugin version

af3494b commit

Sample Code that illustrates the problem

cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode\n" + "Result: " + binaryAgent(result.text) + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled);

            console.log((result.text.length))
  },
  function (error) {

  },
  {
      preferFrontCamera : false, // iOS and Android
      showFlipCameraButton : true, // iOS and Android
      showTorchButton : true, // iOS and Android
      torchOn: true, // Android, launch with the torch switched on (if available)
      saveHistory: false ,// Android, save scan history (default false)
      prompt : "Ubique la parte detraz de la cédula", // Android
      resultDisplayDuration: 3500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500
      formats : "PDF_417", // default: all but PDF_417 and RSS_EXPANDED
      orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device

  }

);

Logs taken while reproducing problem

andersborgabiro commented 7 years ago

It might be due to this https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/532.

The image seems to be based on a low-quality, low-resolution and low-contrast JPEG, and it's not complete: It's cut at the bottom. This image shouldn't be readable.

Can you submit a better and complete image?

jasj commented 7 years ago

i fond this implementation but its is not an cordova pluggin

https://github.com/TheLevelUp/ZXingObjC

jasj commented 7 years ago

pdfluiout

its works greate in android but not in iphone

andersborgabiro commented 7 years ago

That's extremely detailed. I can't read it with a new Android phone either. This is no doubt close to or even beyond the resolution limit of video preview.

jasj commented 7 years ago

I think that the 20171030_132322 problem is with binary encode on pdf417 at iphone

andersborgabiro commented 7 years ago

Check the Zxing documentation for whether it supports binary data for iOS.

https://github.com/zxing/zxing

jasj commented 7 years ago

indeed the problem is iOS before sdk ios11 do not support binary in barcodes scaners of avfundation , now its a new framework called Vision. I am worikin in a workarround for now. using private keys

2017-11-03 6:15 GMT-06:00 Anders Borg notifications@github.com:

Check the Zxing documentation for whether it supports binary data for iOS.

https://github.com/zxing/zxing

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/519#issuecomment-341687590, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTssTnYTJST3nmyT3aI2shPEnqtCUc_ks5sywPlgaJpZM4OqnK5 .

-- Ing. Juan Andres Segreda Johanning Ingeniero Electrónico

lock[bot] commented 6 years ago

This thread has been automatically locked.