Skip to content

Commit

Permalink
Try
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 13, 2024
1 parent 2339a06 commit 07545f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ jobs:
setup: |
brew install meson llvm
build: |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export cc=clang
export cxx=clang++
clang --version
MACOSX_DEPLOYMENT_TARGET=11.0 yarn workspace @napi-rs/image build --target aarch64-apple-darwin --features with_simd
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ resolver = "2"
[profile.release]
lto = 'fat'
codegen-units = 1
debug = true
strip = 'symbols'
2 changes: 1 addition & 1 deletion packages/binding/__test__/transformer.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ test('should be able to create transformer from raw rgba pixels', async (t) => {
})

test('should be able to create transformer from SVG', async (t) => {
await t.notThrowsAsync(() => Transformer.fromSvg(SVG).png())
await t.notThrowsAsync(() => Transformer.fromSvg(SVG).jpeg())
})
4 changes: 2 additions & 2 deletions packages/binding/src/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,14 @@ impl Transformer {
#[napi]
/// Support CSS3 color, e.g. rgba(255, 255, 255, .8)
pub fn from_svg(
input: Either<String, Buffer>,
input: Either<String, JsBuffer>,
background: Option<String>,
) -> Result<Transformer> {
let options = Options::default();

let mut tree = match input {
Either::A(a) => usvg::Tree::from_str(a.as_str(), &options),
Either::B(b) => usvg::Tree::from_data(b.as_ref(), &options),
Either::B(b) => usvg::Tree::from_data(b.into_value()?.as_ref(), &options),
}
.map_err(|err| Error::from_reason(format!("{err}")))?;
tree.postprocess(Default::default(), &FONT_DB);
Expand Down

0 comments on commit 07545f0

Please sign in to comment.