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

Update to ZXing 3.3.0 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ qrdecoder.decode(path,

```javascript
{
ZXingLocation: "/path",
try_harder: false,
ZXingLocation: "/path",
try_harder: false,
multi: false
}
```

## ZXing
In this repository are two jars (javase.jar and core.jar). Both of these belong to https://github.com/zxing/zxing and were retrieved from http://repo1.maven.org/maven2/com/google/zxing/
In this repository are three jars: javase-3.3.0.jar, core-3.3.0.jar and jcommander-1.60.jar.
The two first of these belong to https://github.com/zxing/zxing and were retrieved from http://repo1.maven.org/maven2/com/google/zxing/
The last one is a dependency of ZXing which belong to https://github.com/cbeust/jcommander and was retrieved from https://repo1.maven.org/maven2/com/beust/jcommander/

ZXing included only for ease of use.

Expand Down
8 changes: 6 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ module.exports = function (options) {
}

if(defaults.ZXingVersion == null) {
defaults.ZXingVersion = "-3.1.0"
defaults.ZXingVersion = "3.3.0"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the "-" separator outside the variable, however I wonder now if it was voluntarily put here for some reason in the first place. Do not hesitate to rollback on this if needed.

}

if(defaults.JCommanderVersion == null) {
defaults.JCommanderVersion = "1.60"
}

var commandLineOptions = " ";
Expand All @@ -25,7 +29,7 @@ module.exports = function (options) {
}
return {
decode: function(filePath, cb) {
exec('java -cp '+path.join(defaults.ZXingLocation, 'javase', 'javase'+defaults.ZXingVersion+'.jar')+cpSeparator+path.join(defaults.ZXingLocation, 'core', 'core'+defaults.ZXingVersion+'.jar')+' com.google.zxing.client.j2se.CommandLineRunner'+commandLineOptions+''+filePath,
exec('java -cp '+path.join(defaults.ZXingLocation, 'javase', 'javase-'+defaults.ZXingVersion+'.jar')+cpSeparator+path.join(defaults.ZXingLocation, 'lib', 'jcommander-'+defaults.JCommanderVersion+'.jar')+cpSeparator+path.join(defaults.ZXingLocation, 'core', 'core-'+defaults.ZXingVersion+'.jar')+' com.google.zxing.client.j2se.CommandLineRunner'+commandLineOptions+''+filePath,
function(err, stdout, stderr){
var qrcode = "";
var errorCache = null;
Expand Down
Binary file removed zxing/core/core-3.1.0.jar
Binary file not shown.
Binary file added zxing/core/core-3.3.0.jar
Binary file not shown.
Binary file removed zxing/javase/javase-3.1.0.jar
Binary file not shown.
Binary file added zxing/javase/javase-3.3.0.jar
Binary file not shown.
Binary file added zxing/lib/jcommander-1.60.jar
Binary file not shown.