You've already forked AstralRinth
forked from didirus/AstralRinth
Update file restrictions, download counting, project colors, etc (#515)
* Update file restrictions, download counting, project colors, etc * Run fmt + clippy + prepare
This commit is contained in:
@@ -3,8 +3,9 @@ use image::imageops::FilterType;
|
||||
use image::{EncodableLayout, ImageError};
|
||||
|
||||
pub fn get_color_from_img(data: &[u8]) -> Result<Option<u32>, ImageError> {
|
||||
let image =
|
||||
image::load_from_memory(data)?.resize(256, 256, FilterType::Nearest);
|
||||
let image = image::load_from_memory(data)?
|
||||
.resize(256, 256, FilterType::Nearest)
|
||||
.crop_imm(128, 128, 64, 64);
|
||||
let color = color_thief::get_palette(
|
||||
image.to_rgb8().as_bytes(),
|
||||
ColorFormat::Rgb,
|
||||
|
||||
Reference in New Issue
Block a user