From 063724ee83ac1b273bc0fb8507850faabd9e6b2b Mon Sep 17 00:00:00 2001 From: aruZeta Date: Sat, 1 Oct 2022 13:41:44 +0200 Subject: [PATCH 1/5] [add] Set back links to develop --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0e84d13..1b0ce36 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

@@ -46,7 +46,7 @@ myQR.printTerminal ```

- +

--- @@ -60,7 +60,7 @@ myQR.printSvg ```

- +

--- @@ -72,7 +72,7 @@ myQR.printSvg("#1d2021","#98971a") ```

- +

`"#1d2021"` sets the "light" or "background" color. @@ -87,7 +87,7 @@ myQR.printSvg("#1d2021","#98971a",60) ```

- +

`60` sets the alignment patterns' roundness to 60%. @@ -101,7 +101,7 @@ myQR.printSvg("#1d2021","#98971a",100,100) ```

- +

The first `100` sets the alignment patterns' roundness to 100% @@ -116,7 +116,7 @@ myQR.printSvg("#1d2021","#98971a",100,100,25) ```

- +

The last `25` sets the module's separation to 25%. @@ -136,7 +136,7 @@ myQR.printSvg("#1d2021","#98971a",100,100,25,svgImg=readFile("QRgen-logo.svg")) ```

- +

`svgImg` adds an SVG image embed in the center of generated @@ -185,7 +185,7 @@ myQR.renderImg ```

- +

--- @@ -197,7 +197,7 @@ myQR.renderImg("#1d2021","#98971a") ```

- +

`"#1d2021"` sets the "light" or "background" color. @@ -212,7 +212,7 @@ myQR.renderImg("#1d2021","#98971a",60) ```

- +

`60` sets the alignment patterns' roundness to 60%. @@ -226,7 +226,7 @@ myQR.renderImg("#1d2021","#98971a",100,100) ```

- +

The first `100` sets the alignment patterns' roundness to 100% @@ -241,7 +241,7 @@ myQR.renderImg("#1d2021","#98971a",100,100,25) ```

- +

The last `25` sets the module's separation to 25%. @@ -261,7 +261,7 @@ myQR.renderImg("#1d2021","#98971a",100,100,25,img=readImage("QRgen-logo.png")) ```

- +

`img` embeds an `Image` in the center of the generated QR code, @@ -278,14 +278,14 @@ Note that you can change the resolution of the generated image by setting ## Documentation -Check the [docs](https://aruzeta.github.io/QRgen/main/QRgen.html) to +Check the [docs](https://aruzeta.github.io/QRgen/develop/QRgen.html) to know more about the main API. ## More examples Check my simple terminal app's code, [QRterm](https://github.com/aruZeta/QRterm), which uses this library to generate QR codes from your terminal, and also it's -[logo generator](https://github.com/aruZeta/QRterm/blob/main/src/generateLogo.nim). +[logo generator](https://github.com/aruZeta/QRterm/blob/develop/src/generateLogo.nim). ## License From c9dcfcbeda3cb254105a14bab1fb674482c67f5f Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Sun, 28 Jan 2024 20:59:22 +0100 Subject: [PATCH 2/5] support padding in renderImg --- src/QRgen/renderer.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/QRgen/renderer.nim b/src/QRgen/renderer.nim index 3c5dde0..a47f9c7 100644 --- a/src/QRgen/renderer.nim +++ b/src/QRgen/renderer.nim @@ -47,6 +47,7 @@ proc renderImg*( moRad: Percentage = 0, moSep: Percentage = 0, pixels: uint32 = 512, + padding: uint8 = 5, img: Image = Image(width: 0, height: 0), imgCoords: tuple[x, y, w, h: uint8] = self.genDefaultCoords ): Image = @@ -78,10 +79,10 @@ proc renderImg*( ## will be. You can change this by setting `imgCoords`, which contains a ## tuple with the `x,y` position of `img` and it's width an height. let - modules: uint8 = self.drawing.size + 10 + modules: uint8 = self.drawing.size + padding * 2 modulePixels: uint16 = (pixels div modules).uint16 - pixelsMargin: uint16 = (pixels mod modules).uint16 div 2 + modulePixels*5 - actualSize: uint32 = modulePixels.uint32*(modules-10) + (pixelsMargin+1)*2 + pixelsMargin: uint16 = (pixels mod modules).uint16 div 2 + modulePixels * padding + actualSize: uint32 = modulePixels.uint32*(modules-(padding * 2)) + (pixelsMargin+1)*2 let pixels: uint32 = if actualSize < pixels: actualSize else: pixels From b6f506c1f651c014e2cd164da75454967ab96a32 Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Sun, 28 Jan 2024 21:47:59 +0100 Subject: [PATCH 3/5] move padding as last argument --- src/QRgen/renderer.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QRgen/renderer.nim b/src/QRgen/renderer.nim index a47f9c7..f8dde2d 100644 --- a/src/QRgen/renderer.nim +++ b/src/QRgen/renderer.nim @@ -47,9 +47,9 @@ proc renderImg*( moRad: Percentage = 0, moSep: Percentage = 0, pixels: uint32 = 512, - padding: uint8 = 5, img: Image = Image(width: 0, height: 0), - imgCoords: tuple[x, y, w, h: uint8] = self.genDefaultCoords + imgCoords: tuple[x, y, w, h: uint8] = self.genDefaultCoords, + padding: uint8 = 5 ): Image = ## Print a `DrawedQRCode` in PNG format (returned as a `Image` from pixie). ## From 5cca07c0cebb91c69ff09dce11380115632d54dc Mon Sep 17 00:00:00 2001 From: aruZeta Date: Mon, 29 Jan 2024 17:17:18 +0100 Subject: [PATCH 4/5] chore(ci): update nix & cachix GH action versions --- .github/workflows/benchmarks.yaml | 4 ++-- .github/workflows/gendocs.yaml | 4 ++-- .github/workflows/tests.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmarks.yaml b/.github/workflows/benchmarks.yaml index b7e7dba..598d94d 100644 --- a/.github/workflows/benchmarks.yaml +++ b/.github/workflows/benchmarks.yaml @@ -21,11 +21,11 @@ jobs: - name: Fetch repo's pushed branch uses: actions/checkout@v3 - name: Install nix - uses: cachix/install-nix-action@v16 + uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-22.05 - name: Setup cachix - uses: cachix/cachix-action@v10 + uses: cachix/cachix-action@v12 with: name: my-dotfiles # Holds the cached flake, so not to build it - name: Run benchmarks diff --git a/.github/workflows/gendocs.yaml b/.github/workflows/gendocs.yaml index 0addcc4..35eef1c 100644 --- a/.github/workflows/gendocs.yaml +++ b/.github/workflows/gendocs.yaml @@ -24,11 +24,11 @@ jobs: ref: docs path: destination - name: Install nix - uses: cachix/install-nix-action@v16 + uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-22.05 - name: Setup cachix - uses: cachix/cachix-action@v10 + uses: cachix/cachix-action@v12 with: name: my-dotfiles # Holds the cached flake, so not to build it - name: Build docs diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index eb09b2d..3f076c5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,11 +21,11 @@ jobs: - name: Fetch repo's pushed branch uses: actions/checkout@v3 - name: Install nix - uses: cachix/install-nix-action@v16 + uses: cachix/install-nix-action@v22 with: nix_path: nixpkgs=channel:nixos-22.05 - name: Setup cachix - uses: cachix/cachix-action@v10 + uses: cachix/cachix-action@v12 with: name: my-dotfiles # Holds the cached flake, so not to build it - name: Run tests From 08c20b4780f1523ca5db21b291dbdabc7f68c92e Mon Sep 17 00:00:00 2001 From: aruZeta Date: Mon, 29 Jan 2024 17:44:01 +0100 Subject: [PATCH 5/5] chore(version): 3.1.0 --- QRgen.nimble | 2 +- README.md | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/QRgen.nimble b/QRgen.nimble index 3da4da2..b364630 100644 --- a/QRgen.nimble +++ b/QRgen.nimble @@ -1,6 +1,6 @@ # Package -version = "3.0.0" +version = "3.1.0" author = "aruZeta" description = "A QR code generation library." license = "MIT" diff --git a/README.md b/README.md index 786e903..d5ca6bc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-

@@ -46,7 +46,7 @@ myQR.printTerminal ```

- +

--- @@ -60,7 +60,7 @@ myQR.printSvg ```

- +

--- @@ -72,7 +72,7 @@ myQR.printSvg("#1d2021","#98971a") ```

- +

`"#1d2021"` sets the "light" or "background" color. @@ -87,7 +87,7 @@ myQR.printSvg("#1d2021","#98971a",60) ```

- +

`60` sets the alignment patterns' roundness to 60%. @@ -101,7 +101,7 @@ myQR.printSvg("#1d2021","#98971a",100,100) ```

- +

The first `100` sets the alignment patterns' roundness to 100% @@ -116,7 +116,7 @@ myQR.printSvg("#1d2021","#98971a",100,100,25) ```

- +

The last `25` sets the module's separation to 25%. @@ -136,7 +136,7 @@ myQR.printSvg("#1d2021","#98971a",100,100,25,svgImg=readFile("QRgen-logo.svg")) ```

- +

`svgImg` adds an SVG image embed in the center of generated @@ -185,7 +185,7 @@ myQR.renderImg ```

- +

--- @@ -197,7 +197,7 @@ myQR.renderImg("#1d2021","#98971a") ```

- +

`"#1d2021"` sets the "light" or "background" color. @@ -212,7 +212,7 @@ myQR.renderImg("#1d2021","#98971a",60) ```

- +

`60` sets the alignment patterns' roundness to 60%. @@ -226,7 +226,7 @@ myQR.renderImg("#1d2021","#98971a",100,100) ```

- +

The first `100` sets the alignment patterns' roundness to 100% @@ -241,7 +241,7 @@ myQR.renderImg("#1d2021","#98971a",100,100,25) ```

- +

The last `25` sets the module's separation to 25%. @@ -261,7 +261,7 @@ myQR.renderImg("#1d2021","#98971a",100,100,25,img=readImage("QRgen-logo.png")) ```

- +

`img` embeds an `Image` in the center of the generated QR code, @@ -278,17 +278,17 @@ Note that you can change the resolution of the generated image by setting ## Documentation -Check the [docs](https://aruzeta.github.io/QRgen/develop/QRgen.html) to +Check the [docs](https://aruzeta.github.io/QRgen/main/QRgen.html) to know more about the main API. ## More examples Check my simple terminal app's code, [QRterm](https://github.com/aruZeta/QRterm), which uses this library to generate QR codes from your terminal, and also it's -[logo generator](https://github.com/aruZeta/QRterm/blob/develop/src/generateLogo.nim). +[logo generator](https://github.com/aruZeta/QRterm/blob/main/src/generateLogo.nim). Also check -[this repo's logo and its README images generator](https://github.com/aruZeta/QRgen/blob/develop/src/generateRepoImages.nim). +[this repo's logo and its README images generator](https://github.com/aruZeta/QRgen/blob/main/src/generateRepoImages.nim). ## License