Skip to content

Commit

Permalink
feat: ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiweio committed Nov 25, 2024
1 parent faaa268 commit 81a4836
Show file tree
Hide file tree
Showing 14 changed files with 605 additions and 335 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 Sadman Sakib

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
112 changes: 62 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,90 @@
# picseal
# Picseal

模仿小米照片风格,生成莱卡水印照片。同时支持佳能、尼康、苹果、华为、小米、DJI 等水印。可自动识别,也可自定义处理。
生成类似小米照片风格的莱卡水印照片。支持佳能、尼康、苹果、华为、小米、DJI 等设备的水印生成,可自动识别,也可自定义处理。

在线试用:
- [zhiweio.github.io/picseal](https://zhiweio.github.io/picseal/)
[English](./README_en.md) 中文

## 在线演示

在线试用地址:
- [picseal.vercel.app](https://picseal.vercel.app)
- [picseal.zhiweio.me](https://picseal.zhiweio.me)
- [zhiweio.github.io/picseal](https://zhiweio.github.io/picseal/)

![](./public/screenshot.png)
![应用截图](./public/screenshot.png)

| Deploy with Vercel |
| :-------------------------------------: |
| [![][deploy-button-image]][deploy-link] |
## 部署方法

### 使用 Vercel 部署

#### Deploy locally
| 一键部署到 Vercel |
| :-----------------------------------: |
| [![][deploy-button-image]][deploy-link] |

1. Clone the repository
### 本地部署

1. **克隆项目代码**
```bash
git clone https://github.com/zhiwei/picseal
git clone https://github.com/zhiweio/picseal
```

2. Install dependencies

```bash
# Install Rustup (compiler)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y
```
2. **安装依赖**
```bash
# 安装 Rustup(编译器)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

3. Build and run
# 安装 wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y
```

3. **构建并运行**
```bash
npm install
npm run build
npm run preview
```

#### Deploy with GitHub Pages

Configure `base` in `vite.config.ts` to your GitHub Pages URL (e.g. `https://<USERNAME>.github.io/<REPO>/`).

```javascript
import wasm from 'vite-plugin-wasm'
export default defineConfig({
plugins: [
react(),
wasm(),
topLevelAwait(),
visualizer({ open: true }),
],
server: {
port: 3000,
},
build: {
outDir: 'dist',
target: 'esnext',
},
optimizeDeps: {
exclude: ['picseal'],
},
base: 'https://zhiweio.github.io/picseal/',
})
```

Build and run
### 使用 GitHub Pages 部署

1. 修改 `vite.config.ts` 中的 `base` 配置为你的 GitHub Pages URL(例如:`https://<USERNAME>.github.io/<REPO>/`):
```javascript
import wasm from 'vite-plugin-wasm'

export default defineConfig({
plugins: [
react(),
wasm(),
topLevelAwait(),
visualizer({ open: true }),
],
server: {
port: 3000,
},
build: {
outDir: 'dist',
target: 'esnext',
},
optimizeDeps: {
exclude: ['picseal'],
},
base: 'https://zhiweio.github.io/picseal/',
})
```

2. **构建并部署**
```bash
npm install
npm run pages
```

<!-- LINK GROUP -->
## 作者

- [@Wang Zhiwei](https://github.com/zhiweio)

## 开源协议

[MIT](https://choosealicense.com/licenses/mit/)

<!-- 链接配置 -->
[deploy-button-image]: https://vercel.com/button
[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzhiweio%2Fpicseal&project-name=picseal&repository-name=picseal
90 changes: 90 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Picseal

Generate Leica-style watermark photos inspired by Xiaomi's photo style. Picseal supports automatic or custom watermark generation for Canon, Nikon, Apple, Huawei, Xiaomi, DJI, and more.

English [中文](./README.md)

## Online Demo

Try it online:
- [picseal.vercel.app](https://picseal.vercel.app)
- [picseal.zhiweio.me](https://picseal.zhiweio.me)
- [zhiweio.github.io/picseal](https://zhiweio.github.io/picseal/)

![App Screenshot](./public/screenshot.png)

## Deployment

### Deploy with Vercel

| Deploy with Vercel |
| :-------------------------------------: |
| [![][deploy-button-image]][deploy-link] |

### Deploy Locally

1. **Clone the repository**:
```bash
git clone https://github.com/zhiweio/picseal
```

2. **Install dependencies**:
```bash
# Install Rustup (compiler)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y
```

3. **Build and run**:
```bash
npm install
npm run build
npm run preview
```

### Deploy with GitHub Pages

1. Configure the `base` in `vite.config.ts` to match your GitHub Pages URL (e.g., `https://<USERNAME>.github.io/<REPO>/`):
```javascript
import wasm from 'vite-plugin-wasm'

export default defineConfig({
plugins: [
react(),
wasm(),
topLevelAwait(),
visualizer({ open: true }),
],
server: {
port: 3000,
},
build: {
outDir: 'dist',
target: 'esnext',
},
optimizeDeps: {
exclude: ['picseal'],
},
base: 'https://zhiweio.github.io/picseal/',
})
```

2. **Build and deploy**:
```bash
npm install
npm run pages
```

## Authors

- [@Wang Zhiwei](https://github.com/zhiweio)

## License

[MIT](https://choosealicense.com/licenses/mit/)

<!-- LINK GROUP -->
[deploy-button-image]: https://vercel.com/button
[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzhiweio%2Fpicseal&project-name=picseal&repository-name=picseal
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"preview": "vite preview",
"pages": "npm run build && gh-pages -d dist --dest . --repo `git remote get-url origin`"
"pages": "npm run build && cp vercel.json dist && gh-pages -d dist --dest . --repo `git remote get-url origin`"
},
"dependencies": {
"@ant-design/cssinjs": "^1.22.0",
Expand All @@ -41,8 +41,11 @@
"eslint-plugin-react-refresh": "^0.4.14",
"gh-pages": "^6.2.0",
"rollup-plugin-visualizer": "^5.12.0",
"sharp": "^0.33.5",
"svgo": "^3.3.2",
"typescript": "^5.7.2",
"vite": "^5.4.11",
"vite-plugin-image-optimizer": "^1.1.8",
"vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.3.0"
}
Expand Down
Binary file modified public/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 81a4836

Please sign in to comment.