Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Nov 29, 2024
1 parent 9459d4f commit c8f37a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions martin/src/cog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use regex::Regex;
use std::collections::HashMap;
use std::fs::File;
use std::path::Path;
use std::vec;
use std::{fmt::Debug, path::PathBuf};
use std::{u8, vec};

use std::io::BufWriter;
use tiff::decoder::{Decoder, DecodingResult};
Expand Down Expand Up @@ -315,6 +315,8 @@ impl Source for CogSource {
}
}

#[allow(clippy::cast_sign_loss)]
#[allow(clippy::cast_possible_truncation)]
fn scale_to_u8<T>(
vec: &[T],
samples_count: u8,
Expand Down Expand Up @@ -513,7 +515,7 @@ fn get_meta(path: &PathBuf) -> Result<Meta, FileError> {

fn get_minmax_of_samples(
decoder: &mut Decoder<File>,
path: &PathBuf,
path: &Path,
) -> Result<(Vec<f64>, Vec<f64>), CogError> {
let gdal_metadata_tag = Tag::Unknown(42112);
let metadata = decoder.get_tag_ascii_string(gdal_metadata_tag);
Expand All @@ -529,7 +531,7 @@ fn get_minmax_of_samples(
let value: f64 = cap[2].parse::<f64>().map_err(|_| {
CogError::ParseSTATISTICSValueFailed(
"STATISTICS_MINIMUM".to_string(),
path.clone(),
path.to_path_buf(),
)
})?;
min_values.push(value);
Expand All @@ -545,7 +547,7 @@ fn get_minmax_of_samples(
let value: f64 = cap[2].parse().map_err(|_| {
CogError::ParseSTATISTICSValueFailed(
"sample of STATISTICS_MINIMUM".to_string(),
path.clone(),
path.to_path_buf(),
)
})?;
max_values.push(value);
Expand Down

0 comments on commit c8f37a0

Please sign in to comment.