Skip to content

Commit

Permalink
fix: data url should be standard base64
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Aug 24, 2022
1 parent 3377ca5 commit a59cb40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ impl Task for AsyncDataUrl {
let mut output = format!("data:{};base64,", &self.mime);
match &self.surface_data {
ContextOutputData::Skia(data_ref) => {
base64::encode_config_buf(data_ref.slice(), base64::URL_SAFE, &mut output);
base64::encode_config_buf(data_ref.slice(), base64::STANDARD, &mut output);
}
ContextOutputData::Avif(o) => {
base64::encode_config_buf(o.as_slice(), base64::URL_SAFE, &mut output);
base64::encode_config_buf(o.as_slice(), base64::STANDARD, &mut output);
}
}
Ok(output)
Expand Down

1 comment on commit a59cb40

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: a59cb40 Previous: 3377ca5 Ratio
Draw house#skia-canvas 24 ops/sec (±0.82%) 25 ops/sec (±0.71%) 1.04
Draw house#node-canvas 21 ops/sec (±0.31%) 21 ops/sec (±0.3%) 1
Draw house#@napi-rs/skia 22 ops/sec (±1.24%) 22 ops/sec (±0.71%) 1
Draw gradient#skia-canvas 22.6 ops/sec (±1.43%) 23 ops/sec (±0.75%) 1.02
Draw gradient#node-canvas 20.3 ops/sec (±0.41%) 20 ops/sec (±0.31%) 0.99
Draw gradient#@napi-rs/skia 20.4 ops/sec (±1.23%) 21 ops/sec (±0.93%) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.