1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 04:56:12 +03:00

cargo update

plus some noise around the image crate api evolving and deprecating
some type aliases.
This commit is contained in:
Wez Furlong 2024-07-30 08:27:27 -07:00
parent 9f5c2adb29
commit 56a27e93a9
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
7 changed files with 231 additions and 227 deletions

441
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -200,7 +200,7 @@ pub fn extract_colors_from_image<'lua>(
} }
log::trace!("loading image {file_name}"); log::trace!("loading image {file_name}");
let im = image::io::Reader::open(&file_name) let im = image::ImageReader::open(&file_name)
.map_err(|err| mlua::Error::external(format!("{err:#} while loading {file_name}")))? .map_err(|err| mlua::Error::external(format!("{err:#} while loading {file_name}")))?
.decode() .decode()
.map_err(|err| { .map_err(|err| {

View File

@ -297,7 +297,7 @@ pub(crate) struct ImageInfo {
} }
pub(crate) fn dimensions(data: &[u8]) -> anyhow::Result<ImageInfo> { pub(crate) fn dimensions(data: &[u8]) -> anyhow::Result<ImageInfo> {
let reader = image::io::Reader::new(std::io::Cursor::new(data)).with_guessed_format()?; let reader = image::ImageReader::new(std::io::Cursor::new(data)).with_guessed_format()?;
let format = reader let format = reader
.format() .format()
.ok_or_else(|| anyhow::anyhow!("unknown format!?"))?; .ok_or_else(|| anyhow::anyhow!("unknown format!?"))?;

View File

@ -344,7 +344,7 @@ impl ImageDataType {
pub fn dimensions(&self) -> Result<(u32, u32), InternalError> { pub fn dimensions(&self) -> Result<(u32, u32), InternalError> {
fn dimensions_for_data(data: &[u8]) -> image::ImageResult<(u32, u32)> { fn dimensions_for_data(data: &[u8]) -> image::ImageResult<(u32, u32)> {
let reader = let reader =
image::io::Reader::new(std::io::Cursor::new(data)).with_guessed_format()?; image::ImageReader::new(std::io::Cursor::new(data)).with_guessed_format()?;
let (width, height) = reader.into_dimensions()?; let (width, height) = reader.into_dimensions()?;
Ok((width, height)) Ok((width, height))

View File

@ -243,7 +243,7 @@ fn record_to_cairo_surface(paint_ops: Vec<PaintOp>) -> anyhow::Result<(Recording
extents, extents,
} => { } => {
let image_surface = if format == IS_PNG { let image_surface = if format == IS_PNG {
let decoded = image::io::Reader::new(std::io::Cursor::new(image.as_slice())) let decoded = image::ImageReader::new(std::io::Cursor::new(image.as_slice()))
.with_guessed_format()? .with_guessed_format()?
.decode()?; .decode()?;

View File

@ -9,9 +9,8 @@ use ::window::{Point, Rect};
use anyhow::Context; use anyhow::Context;
use config::{AllowSquareGlyphOverflow, TextStyle}; use config::{AllowSquareGlyphOverflow, TextStyle};
use euclid::num::Zero; use euclid::num::Zero;
use image::io::Limits;
use image::{ use image::{
AnimationDecoder, DynamicImage, Frame, Frames, ImageDecoder, ImageFormat, ImageResult, AnimationDecoder, DynamicImage, Frame, Frames, ImageDecoder, ImageFormat, ImageResult, Limits,
}; };
use lfucache::LfuCache; use lfucache::LfuCache;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
@ -239,7 +238,7 @@ impl FrameDecoder {
let (tx, rx) = sync_channel(2); let (tx, rx) = sync_channel(2);
let buf_reader = lease.get_reader().context("lease.get_reader()")?; let buf_reader = lease.get_reader().context("lease.get_reader()")?;
let reader = image::io::Reader::new(buf_reader) let reader = image::ImageReader::new(buf_reader)
.with_guessed_format() .with_guessed_format()
.context("guess format from lease")?; .context("guess format from lease")?;
let format = reader let format = reader
@ -261,7 +260,7 @@ impl FrameDecoder {
} }
fn run_decoder_thread( fn run_decoder_thread(
reader: image::io::Reader<BoxedReader>, reader: image::ImageReader<BoxedReader>,
format: ImageFormat, format: ImageFormat,
tx: SyncSender<DecodedFrame>, tx: SyncSender<DecodedFrame>,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {

View File

@ -384,7 +384,7 @@ impl ImgCatCommand {
} }
fn image_dimensions(data: &[u8]) -> anyhow::Result<ImageInfo> { fn image_dimensions(data: &[u8]) -> anyhow::Result<ImageInfo> {
let reader = image::io::Reader::new(std::io::Cursor::new(data)).with_guessed_format()?; let reader = image::ImageReader::new(std::io::Cursor::new(data)).with_guessed_format()?;
let format = reader let format = reader
.format() .format()
.ok_or_else(|| anyhow::anyhow!("unknown image format!?"))?; .ok_or_else(|| anyhow::anyhow!("unknown image format!?"))?;