Skip to content

Commit

Permalink
add ignore .ccls-cache
Browse files Browse the repository at this point in the history
update prebuild electron version to 4.0.4
update
remove unused dep
  • Loading branch information
xVan Turing authored and xVan Turing committed Feb 4, 2019
1 parent f5ec701 commit 3f7182c
Show file tree
Hide file tree
Showing 8 changed files with 2,194 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build/*
!build/.gitkeep
node_modules
package-lock.json
prebuilds
prebuilds
.ccls-cache
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ matrix:
before_install:
- echo $CC
- clang -v
- clang++ -v
- clang++ -v
install:
- npm install
- npm install sharp async image-palette image-pixels
34 changes: 3 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## View Latest Doc on [Github](https://github.com/xVanTuring/cquant)
## Usage
> Current Supported Prebuild binary version: Node 6 | 8 | 10 | 11 \
> For Electron user: More Info On: [Electron](#electron)
> For Electron user: Prebuild Supported Version v3 and v4.0.4
> `npm i cquant`
### Basic
Expand All @@ -17,7 +17,7 @@ sharp('path/to/image')
.toBuffer((err, buffer, info) => {
if (!err) {
// you need to set the buffer and
// the depth(only 3 (for RGB),4 (for RGBA) are accepted )
// the depth(only 3 (for RGB) and 4 (for RGBA) are accepted )
// you can use callback, or leave it empty for promise
let iWantForColor = 4
cquant.paletteAsync(buffer, info.channels, iWantForColor).then(res => {
Expand Down Expand Up @@ -57,35 +57,7 @@ const myQueue = async.queue(async (filePath) => {
|---------------|:--------:|
| cquant | 3ms |
| image-palette | 950ms |
## Electron
> All this is on windows, linux is not tested currently;
### Electron v4
**!!! IMPORTANT !!!**\
You **CANNOT** use `electron-rebuild`, it will download the prebuild-binary for electron v3, which is NOT compatible.There are 2 thing you need to do:
1. download v4 [prebuild-binary](https://github.com/xVanTuring/cquant/releases/download/v0.0.18/cquant-v0.0.18-electron-v4-win32-x64.zip),unzip and copy to cquant' build folder.Look like:
```
cquant
--- \build
--- \Release
--- cquant.node
```
> Notice: you may find you version-specifc v4 prebuild-binary in [release](https://github.com/xVanTuring/cquant/releases),look like this `cquant-v0.0.x-electron-v4-win32-x64.zip`. x for version
2. create a `cache file` for electron-prebuild, otherwise it will re-download the v3 version,if you use it for other native module.The final structure will be
```
cquant
--- \build
--- \Release
--- cquant.node
--- .forge-meta
```
and the .forge-meta contains
```
x64--64
```

### Electron v3
1. install `electron-rebuild`
2. run `.\node_modules\.bin\electron-rebuild`
## Build Your Self
### CMake
You need to install [CMake](https://cmake.org/download/) based on your System.
Expand All @@ -98,7 +70,7 @@ To be able to build from the source, you also need the standard build tool based
> for more info you can view project [cmake-js](https://github.com/cmake-js/cmake-js#installation)
Basically you need run this command
``` bash
cmake-js -r electron -v 4.0.0 rebuild # for electron
cmake-js -r electron -v 4.0.4 rebuild # for electron
cmake-js -r node -v 10.0.0 rebuild # for node
```
And of course if you use `electron-prebuild` make sure you add the `cache file` mentioned before
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ install:
- ps: node --version
- cmd: git submodule update --init --recursive
- cmd: npm install
- cmd: npm install sharp async image-palette image-pixels
build: off
test_script:
- npm run test
Loading

0 comments on commit 3f7182c

Please sign in to comment.