mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 12:13:27 +00:00
Enable thumbnail support for webp images (#1634)
* Enable thumbnail support for webp images * Remove webp optional dep from sd-images crate
This commit is contained in:
parent
0f3d7a2a64
commit
b827f9cc66
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -6907,7 +6907,6 @@ dependencies = [
|
|||
"specta",
|
||||
"thiserror",
|
||||
"tracing 0.2.0",
|
||||
"webp",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -14,7 +14,6 @@ heif = ["dep:libheif-rs", "dep:libheif-sys"]
|
|||
|
||||
[dependencies]
|
||||
image = "0.24.7"
|
||||
webp = { version = "0.2.6", optional = true }
|
||||
thiserror = "1.0.49"
|
||||
resvg = "0.36.0"
|
||||
rspc = { workspace = true, optional = true } # error conversion
|
||||
|
|
|
@ -11,9 +11,9 @@ pub const MAXIMUM_FILE_SIZE: u64 = MIB * 192;
|
|||
/// These are roughly all extensions supported by the `image` crate, as of `v0.24.7`.
|
||||
///
|
||||
/// We only support images that have both good encoding and decoding support, without external C-based dependencies (e.g. `avif`)
|
||||
pub const GENERIC_EXTENSIONS: [&str; 16] = [
|
||||
pub const GENERIC_EXTENSIONS: [&str; 17] = [
|
||||
"bmp", "dib", "ff", "gif", "ico", "jpg", "jpeg", "png", "pnm", "qoi", "tga", "icb", "vda",
|
||||
"vst", "tiff", "tif",
|
||||
"vst", "tiff", "tif", "webp",
|
||||
];
|
||||
pub const SVG_EXTENSIONS: [&str; 2] = ["svg", "svgz"];
|
||||
pub const PDF_EXTENSIONS: [&str; 1] = ["pdf"];
|
||||
|
@ -67,6 +67,7 @@ pub enum ConvertableExtension {
|
|||
Svg,
|
||||
Svgz,
|
||||
Pdf,
|
||||
Webp,
|
||||
}
|
||||
|
||||
impl Display for ConvertableExtension {
|
||||
|
@ -107,6 +108,7 @@ impl TryFrom<String> for ConvertableExtension {
|
|||
"svg" => Ok(Self::Svg),
|
||||
"svgz" => Ok(Self::Svgz),
|
||||
"pdf" => Ok(Self::Pdf),
|
||||
"webp" => Ok(Self::Webp),
|
||||
_ => Err(crate::Error::Unsupported),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ export type Composite = "Unknown" | "False" | "General" | "Live"
|
|||
|
||||
export type ConvertImageArgs = { location_id: number; file_path_id: number; delete_src: boolean; desired_extension: ConvertableExtension; quality_percentage: number | null }
|
||||
|
||||
export type ConvertableExtension = "bmp" | "dib" | "ff" | "gif" | "ico" | "jpg" | "jpeg" | "png" | "pnm" | "qoi" | "tga" | "icb" | "vda" | "vst" | "tiff" | "tif" | "heif" | "heifs" | "heic" | "heics" | "avif" | "avci" | "avcs" | "svg" | "svgz" | "pdf"
|
||||
export type ConvertableExtension = "bmp" | "dib" | "ff" | "gif" | "ico" | "jpg" | "jpeg" | "png" | "pnm" | "qoi" | "tga" | "icb" | "vda" | "vst" | "tiff" | "tif" | "heif" | "heifs" | "heic" | "heics" | "avif" | "avci" | "avcs" | "svg" | "svgz" | "pdf" | "webp"
|
||||
|
||||
export type CreateEphemeralFolderArgs = { path: string; name: string | null }
|
||||
|
||||
|
|
Loading…
Reference in a new issue