[package]
name = "pic-scale-js"
version = "0.7.11"
edition = "2024"
description = "Node.js and WASM bindings for pic-scale image resampling"
license = "BSD-3-Clause OR Apache-2.0"
keywords = ["scale", "resize", "image-resize"]
authors = ["Radzivon Bartoshyk"]
documentation = "https://github.com/awxkee/pic-scale"
categories = ["multimedia::images", "multimedia::video"]
homepage = "https://github.com/awxkee/pic-scale"
repository = "https://github.com/awxkee/pic-scale"
exclude = ["*.jpg", "/assets", "*.png", "*.sh", "/assets/*", "/.github"]
rust-version = "1.89.0"

[lib]
crate-type = ["cdylib"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.yuv]
version = "0.8"

[dependencies]
pic-scale = { path = "../", features = ["avx", "neon"] }
thiserror = "2.0.18"
img-parts = "0.4.0"
image = { git = "https://github.com/image-rs/image", rev = "73f19685208fd36f847aa70be72a7dae16c5a808", features = ["jpeg", "png", "webp", "tiff", "bmp", "ico", "qoi", "gif"], default-features = false }
kamadak-exif = "0.6.1"
bytemuck = "1.25.0"
jxl = { version = "0.4.3" }
maroontree = { version = "0.1.4", default-features = false }
fast_transpose = "0.2.7"
jixel = "0.2.5"
hpvca = "0.1.9"
hpvcd = "0.2.3"
yuv = "0.8.16"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
napi = { version = "3.9.0", features = ["napi4", "tokio_rt"], optional = true }
napi-derive = { version = "3.5.6", optional = true }
tokio = { version = "1", features = ["fs"], optional = true }
wasm-bindgen = { version = "0.2.122", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2.122", optional = true }
js-sys = { version = "0.3", optional = true }

[build-dependencies]
napi-build = { version = "2", optional = true }

[features]
default = []
napi = ["dep:napi", "dep:napi-derive", "dep:tokio", "dep:napi-build"]
wasm = ["dep:wasm-bindgen", "dep:js-sys"]
x86_set = ["pic-scale/avx512", "pic-scale/avx", "pic-scale/sse", "maroontree/avx", "image/avif-native"]
aarch64_set = ["pic-scale/rdm", "pic-scale/sve", "pic-scale/nightly_i8mm", "maroontree/neon", "image/avif-native"]

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols"

[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-O", "--enable-simd", "--enable-bulk-memory", "--enable-nontrapping-float-to-int"]