Skip to content

Commit 139fbe9

Browse files
committed
Add maxLogoWidth&maxLogoHeight options
Add maxLogoWidth&maxLogoHeight options
1 parent 883975d commit 139fbe9

File tree

5 files changed

+115
-55
lines changed

5 files changed

+115
-55
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(grunt) {
1212
`/**
1313
* EasyQRCodeJS
1414
*
15-
* Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js framework. Support binary(hex) data mode.(Running with DOM on client side)
15+
* Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js, Svelte framework. Support binary(hex) data mode.(Running with DOM on client side)
1616
*
1717
* Version <%=pkg.version %>
1818
*

dist/easy.qrcode.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "easyqrcodejs",
3-
"version": "4.3.5",
4-
"description": "Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js framework. Support binary(hex) data mode.(Running with DOM on client side)",
3+
"version": "4.4.0",
4+
"description": "Cross-browser QRCode generator for pure javascript. Support Canvas, SVG and Table drawing methods. Support Dot style, Logo, Background image, Colorful, Title etc. settings. Support Angular, Vue.js, React, Next.js, Svelte framework. Support binary(hex) data mode.(Running with DOM on client side)",
55
"main": "dist/easy.qrcode.min.js",
66
"scripts": {},
77
"homepage": "https://github.com/ushelp/EasyQRCodeJS#readme",

readme.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,14 @@ var qrcode = new QRCode(DOM_object, options_object);
222222

223223
// ====== Logo
224224
/*
225-
logo:"../demo/logo.png", // Relative address, relative to `easy.qrcode.min.js`
226-
logo:"http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png",
227-
logoWidth:80, // width. default is automatic width
228-
logoHeight:80, // height. default is automatic height
229-
logoBackgroundColor:'#fffff', // Logo backgroud color, Invalid when `logBgTransparent` is true; default is '#ffffff'
230-
logoBackgroundTransparent:false, // Whether use transparent image, default is false
225+
logo: "../demo/logo.png", // Relative address, relative to `easy.qrcode.min.js`
226+
logo: "http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png",
227+
logoWidth: 80, // fixed logo width. default is `width/3.5`
228+
logoHeight: 80, // fixed logo height. default is `heigth/3.5`
229+
logoMaxWidth: undefined, // Maximum logo width. if set will ignore `logoWidth` value
230+
logoMaxHeight: undefined, // Maximum logo height. if set will ignore `logoHeight` value
231+
logoBackgroundColor: '#fffff', // Logo backgroud color, Invalid when `logBgTransparent` is true; default is '#ffffff'
232+
logoBackgroundTransparent: false, // Whether use transparent image, default is false
231233
*/
232234

233235
// ====== Backgroud Image
@@ -339,8 +341,10 @@ var qrcode = new QRCode(DOM_object, options_object);
339341
| **quietZoneColor** | N | String | `rgba(0,0,0,0)` | Background CSS color to Quiet Zone | &nbsp; |
340342
| Logo options| --- | ---|---|---|---|
341343
| **logo** | N | String | `undefined` | Logo Image Path or Base64 encoded image. If use relative address, relative to `easy.qrcode.min.js` | &nbsp; |
342-
| **logoWidth** | N | Number | `undefined` | Height | &nbsp; |
343-
| **logoHeight** | N | Number | `undefined` | Width | &nbsp; |
344+
| **logoWidth** | N | Number | `width/3.5` | Fixed logo width. | &nbsp; |
345+
| **logoHeight** | N | Number | `height/3.5` | fixed logo height. | &nbsp; |
346+
| **maxLogoWidth** | N | Number | `undefined` | Maximum logo width. if set will ignore `logoWidth` value. | &nbsp; |
347+
| **maxLogoHeight** | N | Number | `undefined` | Maximum logo height. if set will ignore `logoHeight` value. | &nbsp; |
344348
| **logoBackgroundTransparent** | N | Boolean | `false` | Whether the background transparent image(`PNG`) shows transparency. When `true`, `logoBackgroundColor` is invalid | &nbsp; |
345349
| **logoBackgroundColor** | N | String | `#ffffff` | Set Background CSS Color when image background transparent. Valid when `logoBackgroundTransparent` is `false` | &nbsp; |
346350
| Backgroud Image options| ---|--- |---|---|---|

0 commit comments

Comments
 (0)