🚨 render timeout & more

- Puppeteer timeout crash fixed
- Docs updated in `bbpkg.configure`
- Options type set as optional in `BitmapsGenerator.ts`
- Changelogs added in `CHANGELOG.md`
This commit is contained in:
ful1e5 2021-03-01 18:58:21 +05:30
parent 7ca84b389c
commit 50c74ae51e
3 changed files with 110 additions and 113 deletions

View file

@ -9,173 +9,175 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Bibata Rainbow packages move to own repo - Bibata Rainbow packages move to own repo
- Format `svg` files - puppeteer `svg` element timeout fixed
- optional options typing in `BitmapGenerator.ts`
- Format `svg` files
## [Bibata v1.1.0] - 26 Feb 2021 ## [Bibata v1.1.0] - 26 Feb 2021
### Added ### Added
- new **[copr](https://copr.fedorainfracloud.org/coprs/peterwu/rendezvous/package/bibata-cursor-themes/)** package by @peterwu - new **[copr](https://copr.fedorainfracloud.org/coprs/peterwu/rendezvous/package/bibata-cursor-themes/)** package by @peterwu
- `.svg` files separated to `<root>/svg` - `.svg` files separated to `<root>/svg`
- Customizable Windows & UNIX cursors #91 - Customizable Windows & UNIX cursors #91
- Easy build system with `Make` supports - Easy build system with `Make` supports
- Make docs in[README.md](./README.md#manual-build) - Make docs in[README.md](./README.md#manual-build)
- use builtin clickgen WinPackager for Windows package - use builtin clickgen WinPackager for Windows package
- Constant frames in animated cursors - Constant frames in animated cursors
- Smooth animation in Windows cursors - Smooth animation in Windows cursors
- `install` & `uninstall` with `make` commands - `install` & `uninstall` with `make` commands
### Changed ### Changed
- Individual cursor build with clickgen v1.1.8 #93 - Individual cursor build with clickgen v1.1.8 #93
- puppeteer 'single-process' args removed - puppeteer 'single-process' args removed
- All Bitmapping code structured in `bitmapper` directory - All Bitmapping code structured in `bitmapper` directory
- builder code structured inside `builder` directory - builder code structured inside `builder` directory
- `builder` package renamed to `bbpkg` - `builder` package renamed to `bbpkg`
- Symblinks provided by `bbpkg`(new Bibata builder) - Symblinks provided by `bbpkg`(new Bibata builder)
- Automatic build environment setup with `make` - Automatic build environment setup with `make`
- Logging file removed - Logging file removed
- Fix dnf runtime requirements packages ful1e5/apple_cursor#34 - Fix dnf runtime requirements packages ful1e5/apple_cursor#34
- Fix grabbing cursors symlinks #87 - Fix grabbing cursors symlinks #87
- Fix Cursors not available for Login Window in Linux Mint 20 #88 - Fix Cursors not available for Login Window in Linux Mint 20 #88
- Dirty pixel in `move` cursor fixed #94 - Dirty pixel in `move` cursor fixed #94
## [Bibata v1.0.3] - 10 Nov 2020 ## [Bibata v1.0.3] - 10 Nov 2020
### Added ### Added
- Case insensitive `colors key` replace in **bibata-core** - Case insensitive `colors key` replace in **bibata-core**
- **Alternate.cur** added in Windows package - **Alternate.cur** added in Windows package
- `minimumFrames` frames handler added for animated cursors in **bibata-core** - `minimumFrames` frames handler added for animated cursors in **bibata-core**
### Changed ### Changed
- Files download reference change to [pling.com](https://www.pling.com/p/1197198/) in `PLING.bbcode` - Files download reference change to [pling.com](https://www.pling.com/p/1197198/) in `PLING.bbcode`
- Scripts in `package.json` - Scripts in `package.json`
- Change reference of **Alternate.cur** to `right_ptr` - Change reference of **Alternate.cur** to `right_ptr`
- fixed #82 improvement to X-cursor (feature request) - fixed #82 improvement to X-cursor (feature request)
- fixed #81 Corner resize cursors are not coloured (bug) - fixed #81 Corner resize cursors are not coloured (bug)
## [Bibata v1.0.2] - 30 Oct 2020 ## [Bibata v1.0.2] - 30 Oct 2020
### Added ### Added
- Separate **GitHib Action** workflow for **pull-request** - Separate **GitHib Action** workflow for **pull-request**
- **pkg_info.py** inside `builder` module - **pkg_info.py** inside `builder` module
- `builder` module docs - `builder` module docs
### Changed ### Changed
- Windows Resize cursors wrong implementation fixed **#76** [Reopen] - Windows Resize cursors wrong implementation fixed **#76** [Reopen]
- **Rich Black** color in `watch: background` (Bibata Amber) **#78** - **Rich Black** color in `watch: background` (Bibata Amber) **#78**
- PyPi Requirements provided inside `setup.py` - PyPi Requirements provided inside `setup.py`
- locked clickgen to **1.1.7** - locked clickgen to **1.1.7**
- Package information provider module changed to `builder/pkg_info.py` - Package information provider module changed to `builder/pkg_info.py`
## [Bibata v1.0.1] - 8 Oct 2020 ## [Bibata v1.0.1] - 8 Oct 2020
### Added ### Added
- **[builder](./builder/)** python package - **[builder](./builder/)** python package
- Build only **x11** cursors by passing `--x11` flag in `build.py` - Build only **x11** cursors by passing `--x11` flag in `build.py`
- Build only **win** cursors by passing `--win` flag in `build.py` - Build only **win** cursors by passing `--win` flag in `build.py`
- Bump up **clickgen** version to **1.1.7** (KDE cursors fix patch) - Bump up **clickgen** version to **1.1.7** (KDE cursors fix patch)
- `22px` size added (suggestion by **@gotroot** from pling.com) - `22px` size added (suggestion by **@gotroot** from pling.com)
### Changed ### Changed
- Browser args changed in `bibata-core` **BitmapGenerator** - Browser args changed in `bibata-core` **BitmapGenerator**
- **yarn** scripts updated - **yarn** scripts updated
- **yarn-packages** description updated - **yarn-packages** description updated
- **Installation** docs updated in [README.md](./README.md) & [PLING.bbcode](./PLING.bbcode) - **Installation** docs updated in [README.md](./README.md) & [PLING.bbcode](./PLING.bbcode)
- remove additional comments in **[PULL_REQUEST_TEMPLATE.md](https://github.com/ful1e5/Bibata_Cursor/commit/085221352038a199aae99f828d64b2ae91ace493)** - remove additional comments in **[PULL_REQUEST_TEMPLATE.md](https://github.com/ful1e5/Bibata_Cursor/commit/085221352038a199aae99f828d64b2ae91ace493)**
- #76 Wrong implementation resize cursors **[closed]** - #76 Wrong implementation resize cursors **[closed]**
- #74 `Pillow` pip requirements checking in installation of **clickgen** - #74 `Pillow` pip requirements checking in installation of **clickgen**
## [Bibata v1.0.0] - 3 Oct 2020 ## [Bibata v1.0.0] - 3 Oct 2020
### Changed ### Changed
- `main` as **default** branch - `main` as **default** branch
- Package **size** reduced - Package **size** reduced
- Build process with `python` & [**clickgen**](https://github.com/ful1e5/clickgen) - Build process with `python` & [**clickgen**](https://github.com/ful1e5/clickgen)
- Cursors Redesign => `all_scroll`, `pencil`, `wayland_cursor`, `xcursor` and all `pointer symbols`(with Bigger Symbols) cursors - Cursors Redesign => `all_scroll`, `pencil`, `wayland_cursor`, `xcursor` and all `pointer symbols`(with Bigger Symbols) cursors
- `Bibata Oil` is **end of life** - `Bibata Oil` is **end of life**
- Bitmaps Rendering with [**puppeteer**](https://github.com/puppeteer/puppeteer) - Bitmaps Rendering with [**puppeteer**](https://github.com/puppeteer/puppeteer)
- Build Docs - Build Docs
### Added ### Added
- Bibata Original (Old Bibata) - Bibata Original (Old Bibata)
- Windows Package with **Double Click** installation 😍 - Windows Package with **Double Click** installation 😍
- Maintaining [CHANGELOG.md](./CHANGELOG.md) - Maintaining [CHANGELOG.md](./CHANGELOG.md)
- [CURSORS.md](./CURSORS.md) for all cursors information - [CURSORS.md](./CURSORS.md) for all cursors information
- [PLING.bbcode](./PLING.bbcode) for pling.com Product page docs - [PLING.bbcode](./PLING.bbcode) for pling.com Product page docs
- [GitHub Actions](https://github.com/ful1e5/Bibata_Cursor/actions) added - [GitHub Actions](https://github.com/ful1e5/Bibata_Cursor/actions) added
- New Build with **10x** faster rendering. - New Build with **10x** faster rendering.
- Customizable Colors in **Bibata** Cursors. - Customizable Colors in **Bibata** Cursors.
- Auto framing in animated cursors with [**pixelmatch**](https://github.com/mapbox/pixelmatch) - Auto framing in animated cursors with [**pixelmatch**](https://github.com/mapbox/pixelmatch)
## [Bibata v0.4.2] - 12 January 2020 ## [Bibata v0.4.2] - 12 January 2020
### Changed ### Changed
- same names in Oil and Classic [Fixed again] - same names in Oil and Classic [Fixed again]
## [Bibata v0.4.2.beta.1] - 22 December 2019 ## [Bibata v0.4.2.beta.1] - 22 December 2019
### Changed ### Changed
- Bibata Logo resigned - Bibata Logo resigned
## [Bibata v0.4.2.alpha.2] - 1 December 2019 ## [Bibata v0.4.2.alpha.2] - 1 December 2019
### Added ### Added
- Fresh new Aminated cursors - Fresh new Aminated cursors
- Missing KDE Cursors - Missing KDE Cursors
- Added custom animation-delay tweak script - Added custom animation-delay tweak script
### Changed ### Changed
- Glitch fixed in watch cursor(loading state) - Glitch fixed in watch cursor(loading state)
- Bibata Amber Color changed to #FF8000 - Bibata Amber Color changed to #FF8000
- Bibata Oil is inspired on **adwaita gtk** theme color #272728 - Bibata Oil is inspired on **adwaita gtk** theme color #272728
## [Bibata v0.4.2.alpha.1] - 13 November 2019 ## [Bibata v0.4.2.alpha.1] - 13 November 2019
### Added ### Added
- New build process using python - New build process using python
- Common .svg file for all cursor source(i.e. time saving for modification) - Common .svg file for all cursor source(i.e. time saving for modification)
- Bibata Classic Flavor - Bibata Classic Flavor
- Available for Windows user - Available for Windows user
### Changed ### Changed
- Color & Shadow changed for easy visibility - Color & Shadow changed for easy visibility
- Cursor's corner-shape changed - Cursor's corner-shape changed
- Hot-spots changed - Hot-spots changed
## [Bibata v.0.4.1] - 3 September 2018 ## [Bibata v.0.4.1] - 3 September 2018
### Changed ### Changed
- Locations Fixed - Locations Fixed
- AUR added in README.md - AUR added in README.md
## [Bibata v0.3.1] - 16 March 2018 ## [Bibata v0.3.1] - 16 March 2018
### Changed ### Changed
- Redesign Crosshair - Redesign Crosshair
## [Bibata v0.3] - 3 February 2018 ## [Bibata v0.3] - 3 February 2018
### Added ### Added
- Initial release 🎊 - Initial release 🎊
[unreleased]: https://github.com/ful1e5/Bibata_Cursor/compare/v1.1.0...main [unreleased]: https://github.com/ful1e5/Bibata_Cursor/compare/v1.1.0...main
[bibata v1.1.0]: https://github.com/ful1e5/Bibata_Cursor/compare/v1.0.3...v1.1.0 [bibata v1.1.0]: https://github.com/ful1e5/Bibata_Cursor/compare/v1.0.3...v1.1.0

View file

@ -47,7 +47,7 @@ class BitmapsGenerator {
} }
const html = toHTML(content); const html = toHTML(content);
await page.setContent(html); await page.setContent(html, { timeout: 0 });
const svg = await page.$("#container svg"); const svg = await page.$("#container svg");
@ -57,11 +57,7 @@ class BitmapsGenerator {
return svg; return svg;
} }
public async generateStatic( public async generateStatic(browser: Browser, content: string, key: string) {
browser: Browser,
content: string,
key: string
) {
const page = await browser.newPage(); const page = await browser.newPage();
const svg = await this.getSvgElement(page, content); const svg = await this.getSvgElement(page, content);
@ -86,15 +82,15 @@ class BitmapsGenerator {
} }
private async stopAnimation(page: Page) { private async stopAnimation(page: Page) {
//@ts-ignore const client = await page.target().createCDPSession();
await page._client.send("Animation.setPlaybackRate", { await client.send("Animation.setPlaybackRate", {
playbackRate: 0, playbackRate: 0,
}); });
} }
private async resumeAnimation(page: Page, playbackRate: number) { private async resumeAnimation(page: Page, playbackRate: number) {
//@ts-ignore const client = await page.target().createCDPSession();
await page._client.send("Animation.setPlaybackRate", { await client.send("Animation.setPlaybackRate", {
playbackRate, playbackRate,
}); });
} }
@ -108,18 +104,18 @@ class BitmapsGenerator {
browser: Browser, browser: Browser,
content: string, content: string,
key: string, key: string,
options: { options?: {
playbackRate: number; playbackRate?: number;
diff: number; diff?: number;
frameLimit: number; frameLimit?: number;
framePadding: number; framePadding?: number;
} = {
playbackRate: 0.3,
diff: 0,
frameLimit: 300,
framePadding: 4,
} }
) { ) {
const opt = Object.assign(
{ playbackRate: 0.1, diff: 0, frameLimit: 300, framePadding: 4 },
options
);
const page = await browser.newPage(); const page = await browser.newPage();
const svg = await this.getSvgElement(page, content); const svg = await this.getSvgElement(page, content);
await this.stopAnimation(page); await this.stopAnimation(page);
@ -130,22 +126,22 @@ class BitmapsGenerator {
// Rendering frames till `imgN` matched to `imgN-1` (When Animation is done) // Rendering frames till `imgN` matched to `imgN-1` (When Animation is done)
while (!breakRendering) { while (!breakRendering) {
if (index > options.frameLimit) { if (index > opt.frameLimit) {
throw new Error("Reached the frame limit."); throw new Error("Reached the frame limit.");
} }
this.resumeAnimation(page, options.playbackRate); await this.resumeAnimation(page, opt.playbackRate);
const img: string | Buffer = await this.screenshot(svg); const img: string | Buffer = await this.screenshot(svg);
this.stopAnimation(page); await this.stopAnimation(page);
if (index > 1) { if (index > 1) {
// @ts-ignore // @ts-ignore
const diff = matchImages(prevImg, img); const diff = matchImages(prevImg, img);
if (diff <= options.diff) { if (diff <= opt.diff) {
breakRendering = !breakRendering; breakRendering = !breakRendering;
} }
} }
const number = frameNumber(index, options.framePadding); const number = frameNumber(index, opt.framePadding);
const frame = `${key}-${number}.png`; const frame = `${key}-${number}.png`;
this.saveFrameImage(frame, img); this.saveFrameImage(frame, img);
@ -153,7 +149,6 @@ class BitmapsGenerator {
prevImg = img; prevImg = img;
++index; ++index;
} }
await page.close(); await page.close();
} }
} }

View file

@ -16,7 +16,7 @@ def to_tuple(x: X) -> Tuple[X, X]:
def get_config(bitmaps_dir, **kwargs) -> Dict[str, Any]: def get_config(bitmaps_dir, **kwargs) -> Dict[str, Any]:
"""Return configuration of `GoogleDot` pointers. """Return configuration of `Bibata` pointers.
``` ```
Args: Args: