- bump dependencies
- bump git action versions
This commit is contained in:
23
src/lib.rs
23
src/lib.rs
@@ -1,7 +1,8 @@
|
||||
pub mod error;
|
||||
#[cfg(feature = "python")]
|
||||
mod py;
|
||||
pub mod error;
|
||||
|
||||
use crate::error::Error;
|
||||
use chrono::Utc;
|
||||
use colorcet::ColorMap;
|
||||
use colorgrad::{Gradient, LinearGradient};
|
||||
@@ -23,7 +24,6 @@ use std::{
|
||||
};
|
||||
use zstd::zstd_safe::CompressionLevel;
|
||||
use zstd::{DEFAULT_COMPRESSION_LEVEL, stream::Encoder};
|
||||
use crate::error::Error;
|
||||
|
||||
const TAG_SIZE: usize = 20;
|
||||
const OFFSET_SIZE: usize = 8;
|
||||
@@ -60,7 +60,11 @@ impl IFD {
|
||||
}
|
||||
}
|
||||
|
||||
fn write(&mut self, ijtifffile: &mut IJTiffFile, where_to_write_offset: u64) -> Result<u64, Error> {
|
||||
fn write(
|
||||
&mut self,
|
||||
ijtifffile: &mut IJTiffFile,
|
||||
where_to_write_offset: u64,
|
||||
) -> Result<u64, Error> {
|
||||
let mut tags = self.tags.drain().collect::<Vec<_>>();
|
||||
tags.sort();
|
||||
ijtifffile.file.seek(SeekFrom::End(0))?;
|
||||
@@ -748,7 +752,10 @@ impl IJTiffFile {
|
||||
/// set colormap from named colormap (see [colorcet](https://crates.io/crates/colorcet))
|
||||
pub fn set_colormap<S: AsRef<str>>(&mut self, name: S) -> Result<(), Error> {
|
||||
let name = name.as_ref();
|
||||
let colormap: LinearGradient = name.parse::<ColorMap>()?.try_into().map_err(|_| Error::Conversion)?;
|
||||
let colormap: LinearGradient = name
|
||||
.parse::<ColorMap>()?
|
||||
.try_into()
|
||||
.map_err(|_| Error::Conversion)?;
|
||||
let mut colormap = colormap
|
||||
.colors(256)
|
||||
.into_iter()
|
||||
@@ -896,7 +903,13 @@ impl IJTiffFile {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn write_frame(&mut self, frame: CompressedFrame, c: usize, z: usize, t: usize) -> Result<(), Error> {
|
||||
fn write_frame(
|
||||
&mut self,
|
||||
frame: CompressedFrame,
|
||||
c: usize,
|
||||
z: usize,
|
||||
t: usize,
|
||||
) -> Result<(), Error> {
|
||||
let mut offsets = Vec::new();
|
||||
let mut bytecounts = Vec::new();
|
||||
for tile in frame.bytes {
|
||||
|
||||
Reference in New Issue
Block a user