mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-03 20:31:54 +03:00
Merge branch 'dev' into refactor/bundle-file-names-consistency
This commit is contained in:
commit
a9af8cc13c
6
.changes/change-default-export-option-debugging.md
Normal file
6
.changes/change-default-export-option-debugging.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"tauri-cli": patch:changes
|
||||||
|
"@tauri-apps/cli": patch:changes
|
||||||
|
---
|
||||||
|
|
||||||
|
Change iOS template default export method from deprecated `development` to `debugging`.
|
5
.changes/fix-ipc-fallback.md
Normal file
5
.changes/fix-ipc-fallback.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix IPC fallback (postMessage implementation when custom protocol fails) hanging when sending responses.
|
5
.changes/utils-fix-plugin-reference.md
Normal file
5
.changes/utils-fix-plugin-reference.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri-utils": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix plugin permissions documentation heading for permissions table.
|
@ -242,7 +242,7 @@ pub fn generate_docs(
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let mut permission_table = "".to_string();
|
let mut permission_table = "".to_string();
|
||||||
let permission_table_header =
|
let permission_table_header =
|
||||||
"### Permission Table \n\n<table>\n<tr>\n<th>Identifier</th>\n<th>Description</th>\n</tr>\n"
|
"## Permission Table \n\n<table>\n<tr>\n<th>Identifier</th>\n<th>Description</th>\n</tr>\n"
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let mut default_permission = "## Default Permission\n\n".to_string();
|
let mut default_permission = "## Default Permission\n\n".to_string();
|
||||||
|
@ -6,7 +6,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-name`
|
- `allow-name`
|
||||||
- `allow-tauri-version`
|
- `allow-tauri-version`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -7,7 +7,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-emit`
|
- `allow-emit`
|
||||||
- `allow-emit-to`
|
- `allow-emit-to`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -8,7 +8,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-rgba`
|
- `allow-rgba`
|
||||||
- `allow-size`
|
- `allow-size`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -25,7 +25,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-set-checked`
|
- `allow-set-checked`
|
||||||
- `allow-set-icon`
|
- `allow-set-icon`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -11,7 +11,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-basename`
|
- `allow-basename`
|
||||||
- `allow-is-absolute`
|
- `allow-is-absolute`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -4,7 +4,7 @@ Default permissions for the plugin.
|
|||||||
|
|
||||||
- `allow-close`
|
- `allow-close`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -14,7 +14,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-set-icon-as-template`
|
- `allow-set-icon-as-template`
|
||||||
- `allow-set-show-menu-on-left-click`
|
- `allow-set-show-menu-on-left-click`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -6,7 +6,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-webview-size`
|
- `allow-webview-size`
|
||||||
- `allow-internal-toggle-devtools`
|
- `allow-internal-toggle-devtools`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -26,7 +26,7 @@ Default permissions for the plugin.
|
|||||||
- `allow-theme`
|
- `allow-theme`
|
||||||
- `allow-internal-toggle-maximize`
|
- `allow-internal-toggle-maximize`
|
||||||
|
|
||||||
### Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -62,7 +62,11 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((e) => {
|
||||||
|
console.warn(
|
||||||
|
'IPC custom protocol failed, Tauri will now use the postMessage interface instead',
|
||||||
|
e
|
||||||
|
)
|
||||||
// failed to use the custom protocol IPC (either the webview blocked a custom protocol or it was a CSP error)
|
// failed to use the custom protocol IPC (either the webview blocked a custom protocol or it was a CSP error)
|
||||||
// so we need to fallback to the postMessage interface
|
// so we need to fallback to the postMessage interface
|
||||||
customProtocolIpcFailed = true
|
customProtocolIpcFailed = true
|
||||||
@ -74,7 +78,10 @@
|
|||||||
cmd,
|
cmd,
|
||||||
callback,
|
callback,
|
||||||
error,
|
error,
|
||||||
options,
|
options: {
|
||||||
|
...options,
|
||||||
|
customProtocolIpcBlocked: customProtocolIpcFailed
|
||||||
|
},
|
||||||
payload,
|
payload,
|
||||||
__TAURI_INVOKE_KEY__
|
__TAURI_INVOKE_KEY__
|
||||||
})
|
})
|
||||||
|
@ -174,6 +174,7 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
|
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub(crate) struct HeaderMap(http::HeaderMap);
|
pub(crate) struct HeaderMap(http::HeaderMap);
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for HeaderMap {
|
impl<'de> Deserialize<'de> for HeaderMap {
|
||||||
@ -199,9 +200,13 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize, Default)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
struct RequestOptions {
|
struct RequestOptions {
|
||||||
|
#[serde(default)]
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
|
#[serde(default)]
|
||||||
|
custom_protocol_ipc_blocked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
@ -260,13 +265,15 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
|
|
||||||
match message {
|
match message {
|
||||||
Ok(message) => {
|
Ok(message) => {
|
||||||
|
let options = message.options.unwrap_or_default();
|
||||||
|
|
||||||
let request = InvokeRequest {
|
let request = InvokeRequest {
|
||||||
cmd: message.cmd,
|
cmd: message.cmd,
|
||||||
callback: message.callback,
|
callback: message.callback,
|
||||||
error: message.error,
|
error: message.error,
|
||||||
url: Url::parse(&request.uri().to_string()).expect("invalid IPC request URL"),
|
url: Url::parse(&request.uri().to_string()).expect("invalid IPC request URL"),
|
||||||
body: message.payload.into(),
|
body: message.payload.into(),
|
||||||
headers: message.options.map(|o| o.headers.0).unwrap_or_default(),
|
headers: options.headers.0,
|
||||||
invoke_key: message.invoke_key,
|
invoke_key: message.invoke_key,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -293,9 +300,7 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
.entered();
|
.entered();
|
||||||
|
|
||||||
// the channel data command is the only command that uses a custom protocol on Linux
|
// the channel data command is the only command that uses a custom protocol on Linux
|
||||||
if webview.manager().webview.invoke_responder.is_none()
|
if webview.manager().webview.invoke_responder.is_none() {
|
||||||
&& cmd != crate::ipc::channel::FETCH_CHANNEL_DATA_COMMAND
|
|
||||||
{
|
|
||||||
fn responder_eval<R: Runtime>(
|
fn responder_eval<R: Runtime>(
|
||||||
webview: &crate::Webview<R>,
|
webview: &crate::Webview<R>,
|
||||||
js: crate::Result<String>,
|
js: crate::Result<String>,
|
||||||
@ -310,6 +315,10 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
let _ = webview.eval(&eval_js);
|
let _ = webview.eval(&eval_js);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let can_use_channel_for_response = cmd
|
||||||
|
!= crate::ipc::channel::FETCH_CHANNEL_DATA_COMMAND
|
||||||
|
&& !options.custom_protocol_ipc_blocked;
|
||||||
|
|
||||||
#[cfg(feature = "tracing")]
|
#[cfg(feature = "tracing")]
|
||||||
let _response_span = tracing::trace_span!(
|
let _response_span = tracing::trace_span!(
|
||||||
"ipc::request::response",
|
"ipc::request::response",
|
||||||
@ -327,6 +336,7 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
InvokeResponse::Ok(InvokeBody::Json(v)) => {
|
InvokeResponse::Ok(InvokeBody::Json(v)) => {
|
||||||
if !(cfg!(target_os = "macos") || cfg!(target_os = "ios"))
|
if !(cfg!(target_os = "macos") || cfg!(target_os = "ios"))
|
||||||
&& matches!(v, JsonValue::Object(_) | JsonValue::Array(_))
|
&& matches!(v, JsonValue::Object(_) | JsonValue::Array(_))
|
||||||
|
&& can_use_channel_for_response
|
||||||
{
|
{
|
||||||
let _ = Channel::from_callback_fn(webview, callback).send(v);
|
let _ = Channel::from_callback_fn(webview, callback).send(v);
|
||||||
} else {
|
} else {
|
||||||
@ -338,7 +348,10 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
InvokeResponse::Ok(InvokeBody::Raw(v)) => {
|
InvokeResponse::Ok(InvokeBody::Raw(v)) => {
|
||||||
if cfg!(target_os = "macos") || cfg!(target_os = "ios") {
|
if cfg!(target_os = "macos")
|
||||||
|
|| cfg!(target_os = "ios")
|
||||||
|
|| !can_use_channel_for_response
|
||||||
|
{
|
||||||
responder_eval(
|
responder_eval(
|
||||||
&webview,
|
&webview,
|
||||||
format_callback_result(Result::<_, ()>::Ok(v), callback, error),
|
format_callback_result(Result::<_, ()>::Ok(v), callback, error),
|
||||||
|
@ -18,7 +18,7 @@ exclude = [ "CHANGELOG.md", "/target", "rustfmt.toml" ]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri-utils = { version = "2.0.0-rc.2", path = "../../core/tauri-utils", features = [ "resources" ] }
|
tauri-utils = { version = "2.0.0-rc.2", path = "../../core/tauri-utils", features = [ "resources" ] }
|
||||||
image = "0.24.9"
|
image = "0.25.0"
|
||||||
flate2 = "1.0"
|
flate2 = "1.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
@ -44,11 +44,11 @@ dunce = "1"
|
|||||||
[target."cfg(target_os = \"windows\")".dependencies]
|
[target."cfg(target_os = \"windows\")".dependencies]
|
||||||
uuid = { version = "1", features = [ "v4", "v5" ] }
|
uuid = { version = "1", features = [ "v4", "v5" ] }
|
||||||
bitness = "0.4"
|
bitness = "0.4"
|
||||||
windows-registry = "0.1.1"
|
windows-registry = "0.2.0"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
|
|
||||||
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
|
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
|
||||||
version = "0.52"
|
version = "0.59"
|
||||||
features = [
|
features = [
|
||||||
"Win32_System_SystemInformation",
|
"Win32_System_SystemInformation",
|
||||||
"Win32_System_Diagnostics_Debug"
|
"Win32_System_Diagnostics_Debug"
|
||||||
@ -67,7 +67,7 @@ regex = "1"
|
|||||||
heck = "0.5"
|
heck = "0.5"
|
||||||
ar = "0.9.0"
|
ar = "0.9.0"
|
||||||
md5 = "0.7.0"
|
md5 = "0.7.0"
|
||||||
rpm = "0.14.0"
|
rpm = "0.15.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "tauri_bundler"
|
name = "tauri_bundler"
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs::{read_to_string, File};
|
use std::fs::{read_to_string, File};
|
||||||
|
use std::io::BufReader;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
@ -60,7 +61,7 @@ pub fn list_icon_files(
|
|||||||
}
|
}
|
||||||
// Put file in scope so that it's closed when copying it
|
// Put file in scope so that it's closed when copying it
|
||||||
let icon = {
|
let icon = {
|
||||||
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
|
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
|
||||||
let width = decoder.dimensions().0;
|
let width = decoder.dimensions().0;
|
||||||
let height = decoder.dimensions().1;
|
let height = decoder.dimensions().1;
|
||||||
let is_high_density = common::is_retina(&icon_path);
|
let is_high_density = common::is_retina(&icon_path);
|
||||||
|
@ -22,7 +22,7 @@ use std::{
|
|||||||
collections::BTreeSet,
|
collections::BTreeSet,
|
||||||
ffi::OsStr,
|
ffi::OsStr,
|
||||||
fs::{self, File},
|
fs::{self, File},
|
||||||
io::Write,
|
io::{BufReader, Write},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
|
|||||||
if icon_path.extension() != Some(OsStr::new("png")) {
|
if icon_path.extension() != Some(OsStr::new("png")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
|
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
|
||||||
let width = decoder.dimensions().0;
|
let width = decoder.dimensions().0;
|
||||||
let height = decoder.dimensions().1;
|
let height = decoder.dimensions().1;
|
||||||
let is_retina = common::is_retina(&icon_path);
|
let is_retina = common::is_retina(&icon_path);
|
||||||
@ -127,7 +127,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
|
|||||||
let dest_path = get_dest_path(width, height, is_retina);
|
let dest_path = get_dest_path(width, height, is_retina);
|
||||||
icon.write_to(
|
icon.write_to(
|
||||||
&mut common::create_file(&dest_path)?,
|
&mut common::create_file(&dest_path)?,
|
||||||
image::ImageOutputFormat::Png,
|
image::ImageFormat::Png,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1089
tooling/cli/Cargo.lock
generated
1089
tooling/cli/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -40,10 +40,10 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cargo-mobile2 = { version = "0.13.1", default-features = false }
|
cargo-mobile2 = { version = "0.13.1", default-features = false }
|
||||||
jsonrpsee = { version = "0.22", features = [ "server" ] }
|
jsonrpsee = { version = "0.24", features = [ "server" ] }
|
||||||
jsonrpsee-core = "0.22"
|
jsonrpsee-core = "0.24"
|
||||||
jsonrpsee-client-transport = { version = "0.22", features = [ "ws" ] }
|
jsonrpsee-client-transport = { version = "0.24", features = [ "ws" ] }
|
||||||
jsonrpsee-ws-client = { version = "0.22", default-features = false }
|
jsonrpsee-ws-client = { version = "0.24", default-features = false }
|
||||||
sublime_fuzzy = "0.7"
|
sublime_fuzzy = "0.7"
|
||||||
clap_complete = "4"
|
clap_complete = "4"
|
||||||
clap = { version = "4.5", features = [ "derive", "env" ] }
|
clap = { version = "4.5", features = [ "derive", "env" ] }
|
||||||
@ -61,7 +61,7 @@ json-patch = "2.0"
|
|||||||
tauri-utils = { version = "2.0.0-rc.2", path = "../../core/tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
|
tauri-utils = { version = "2.0.0-rc.2", path = "../../core/tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
|
||||||
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
|
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
jsonschema = "0.17"
|
jsonschema = "0.18"
|
||||||
handlebars = "6.0"
|
handlebars = "6.0"
|
||||||
include_dir = "0.7"
|
include_dir = "0.7"
|
||||||
minisign = "=0.7.3"
|
minisign = "=0.7.3"
|
||||||
@ -79,23 +79,23 @@ ctrlc = "3.4"
|
|||||||
log = { version = "0.4.21", features = [ "kv", "kv_std" ] }
|
log = { version = "0.4.21", features = [ "kv", "kv_std" ] }
|
||||||
env_logger = "0.11.3"
|
env_logger = "0.11.3"
|
||||||
icns = { package = "tauri-icns", version = "0.1" }
|
icns = { package = "tauri-icns", version = "0.1" }
|
||||||
image = { version = "0.24", default-features = false, features = [ "ico" ] }
|
image = { version = "0.25", default-features = false, features = [ "ico" ] }
|
||||||
axum = { version = "0.7.4", features = [ "ws" ] }
|
axum = { version = "0.7.4", features = [ "ws" ] }
|
||||||
html5ever = "0.26"
|
html5ever = "0.26"
|
||||||
kuchiki = { package = "kuchikiki", version = "0.8" }
|
kuchiki = { package = "kuchikiki", version = "0.8" }
|
||||||
tokio = { version = "1", features = [ "macros", "sync" ] }
|
tokio = { version = "1", features = [ "macros", "sync" ] }
|
||||||
common-path = "1"
|
common-path = "1"
|
||||||
serde-value = "0.7.0"
|
serde-value = "0.7.0"
|
||||||
itertools = "0.12"
|
itertools = "0.13"
|
||||||
local-ip-address = "0.6"
|
local-ip-address = "0.6"
|
||||||
css-color = "0.2"
|
css-color = "0.2"
|
||||||
resvg = "0.42.0"
|
resvg = "0.42.0"
|
||||||
dunce = "1"
|
dunce = "1"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
oxc_parser = "0.16"
|
oxc_parser = "0.20"
|
||||||
oxc_span = "0.16"
|
oxc_span = "0.20"
|
||||||
oxc_allocator = "0.16"
|
oxc_allocator = "0.20"
|
||||||
oxc_ast = "0.16"
|
oxc_ast = "0.20"
|
||||||
magic_string = "0.3"
|
magic_string = "0.3"
|
||||||
phf = { version = "0.11", features = ["macros"] }
|
phf = { version = "0.11", features = ["macros"] }
|
||||||
walkdir = "2"
|
walkdir = "2"
|
||||||
|
@ -22,7 +22,7 @@ use image::{
|
|||||||
png::{CompressionType, FilterType as PngFilterType, PngEncoder},
|
png::{CompressionType, FilterType as PngFilterType, PngEncoder},
|
||||||
},
|
},
|
||||||
imageops::FilterType,
|
imageops::FilterType,
|
||||||
open, ColorType, DynamicImage, ImageBuffer, ImageEncoder, Rgba,
|
open, DynamicImage, ExtendedColorType, ImageBuffer, ImageEncoder, Rgba,
|
||||||
};
|
};
|
||||||
use resvg::{tiny_skia, usvg};
|
use resvg::{tiny_skia, usvg};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@ -243,13 +243,18 @@ fn ico(source: &Source, out_dir: &Path) -> Result<()> {
|
|||||||
|
|
||||||
write_png(image.as_bytes(), &mut buf, size)?;
|
write_png(image.as_bytes(), &mut buf, size)?;
|
||||||
|
|
||||||
frames.push(IcoFrame::with_encoded(buf, size, size, ColorType::Rgba8)?)
|
frames.push(IcoFrame::with_encoded(
|
||||||
|
buf,
|
||||||
|
size,
|
||||||
|
size,
|
||||||
|
ExtendedColorType::Rgba8,
|
||||||
|
)?)
|
||||||
} else {
|
} else {
|
||||||
frames.push(IcoFrame::as_png(
|
frames.push(IcoFrame::as_png(
|
||||||
image.as_bytes(),
|
image.as_bytes(),
|
||||||
size,
|
size,
|
||||||
size,
|
size,
|
||||||
ColorType::Rgba8,
|
ExtendedColorType::Rgba8,
|
||||||
)?);
|
)?);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,6 +490,6 @@ fn resize_and_save_png(
|
|||||||
// Encode image data as png with compression.
|
// Encode image data as png with compression.
|
||||||
fn write_png<W: Write>(image_data: &[u8], w: W, size: u32) -> Result<()> {
|
fn write_png<W: Write>(image_data: &[u8], w: W, size: u32) -> Result<()> {
|
||||||
let encoder = PngEncoder::new_with_quality(w, CompressionType::Best, PngFilterType::Adaptive);
|
let encoder = PngEncoder::new_with_quality(w, CompressionType::Best, PngFilterType::Adaptive);
|
||||||
encoder.write_image(image_data, size, size, ColorType::Rgba8)?;
|
encoder.write_image(image_data, size, size, ExtendedColorType::Rgba8)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ pub fn write_options(identifier: &str, mut options: CliOptions) -> crate::Result
|
|||||||
let addr = server.local_addr()?;
|
let addr = server.local_addr()?;
|
||||||
|
|
||||||
let mut module = RpcModule::new(());
|
let mut module = RpcModule::new(());
|
||||||
module.register_method("options", move |_, _| Some(options.clone()))?;
|
module.register_method("options", move |_, _, _| Some(options.clone()))?;
|
||||||
|
|
||||||
let handle = server.start(module);
|
let handle = server.start(module);
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>method</key>
|
<key>method</key>
|
||||||
<string>development</string>
|
<string>debugging</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
Loading…
Reference in New Issue
Block a user