diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be6c73f..23fe722 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,15 @@ name: Test on: push: - branches: [ master ] + branches: [master] + paths-ignore: + - "README_ZH.md" + - "README.md" pull_request: - branches: [ master ] + branches: [master] + paths-ignore: + - "README_ZH.md" + - "README.md" jobs: clippy: @@ -37,4 +43,4 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Run `cargo test` - run: cargo test --all \ No newline at end of file + run: cargo test --all diff --git a/README.md b/README.md index 93915eb..bc906d1 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,13 @@ clipboard-rs is a cross-platform library written in Rust for getting and setting the system-level clipboard content. It supports Linux, Windows, and MacOS. -Currently, the logic for MacOS has been completed, and we are continuing to develop the logic for Linux and Windows. - [简体中文](README_ZH.md) ## Development Plan - [x] MacOS Support - [ ] Linux Support -- [ ] Windows Support +- [x] Windows Support ## Usage @@ -61,14 +59,13 @@ fn main() { let img = ctx.get_image().unwrap(); - println!( - "size={:?},byte len={}", - img.get_size(), - img.get_bytes().len() - ); + img.save_to_path("/tmp/test.png").unwrap(); + + let resize_img = img.thumbnail(300, 300).unwrap(); - img.save_to_file("/tmp/test.png").unwrap(); + resize_img.save_to_path("/tmp/test_thumbnail.png").unwrap(); } + ``` ### Reading Any Format diff --git a/README_ZH.md b/README_ZH.md index 8eb7aa2..c700c66 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -2,15 +2,13 @@ clipboard-rs 是一个用 Rust 语言编写的跨平台库,用于获取和设置操作系统级别的剪贴板内容。它支持 Linux、Windows 和 MacOS。 -目前,MacOS 的逻辑已经完成编写,我们正在继续开发 Linux 和 Windows 的逻辑。 - [简体中文](README_ZH.md) ## 开发计划 - [x] MacOS 支持 - [ ] Linux 支持 -- [ ] Windows 支持 +- [x] Windows 支持 ## 使用方法 @@ -61,15 +59,14 @@ fn main() { let img = ctx.get_image().unwrap(); - println!( - "size={:?},byte len={}", - img.get_size(), - img.get_bytes().len() - ); + img.save_to_path("/tmp/test.png").unwrap(); + + let resize_img = img.thumbnail(300, 300).unwrap(); - img.save_to_file("/tmp/test.png").unwrap(); + resize_img.save_to_path("/tmp/test_thumbnail.png").unwrap(); } + ``` ### 读取任意类型