refactor(extensions): move windows-thumbnail to extensions (#2562)

This commit is contained in:
Huang Xin
2025-11-28 12:44:11 +08:00
committed by GitHub
parent 2b6f7b71b0
commit bd2b45e1c1
7 changed files with 7 additions and 4 deletions
@@ -8,7 +8,7 @@ publish = false
[lib]
name = "windows_thumbnail"
path = "mod.rs"
path = "src/mod.rs"
crate-type = ["cdylib"]
[dependencies]
@@ -434,7 +434,7 @@ pub fn create_thumbnail_with_overlay(cover_bytes: &[u8], requested_size: u32) ->
/// Load the Readest overlay icon.
fn load_overlay_icon() -> Option<DynamicImage> {
// Try embedded icon
let icon_bytes = include_bytes!("../../../../public/icon.png");
let icon_bytes = include_bytes!("../../../public/icon.png");
if let Ok(img) = image::load_from_memory(icon_bytes) {
return Some(img);
}
+5 -2
View File
@@ -1,7 +1,7 @@
use std::{env, fs, path::PathBuf, process::Command};
fn main() {
println!("cargo:rerun-if-changed=src/windows/thumbnail");
println!("cargo:rerun-if-changed=../extensions/windows-thumbnail/src");
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
if target_os == "windows" {
build_windows_thumbnail();
@@ -12,7 +12,10 @@ fn main() {
fn build_windows_thumbnail() {
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let dll_crate_dir = manifest_dir.join("src/windows/thumbnail");
let dll_crate_dir = manifest_dir
.join("..")
.join("extensions")
.join("windows-thumbnail");
let dll_crate_manifest = dll_crate_dir.join("Cargo.toml");
let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".into());