add original image preset to sizing_preset_ids if default preset is null (#15)

This commit is contained in:
Michal Szulczewski 2023-11-12 13:59:11 +01:00 committed by GitHub
parent 64c1fc2c5c
commit 259e88632f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -180,9 +180,13 @@ pub struct BucketConfig {
impl BucketConfig {
#[inline]
pub fn sizing_preset_ids(&self) -> Vec<u32> {
self.presets.keys()
.map(crate::utils::crc_hash)
.collect()
let mut presets: Vec<u32> =
self.presets.keys().map(crate::utils::crc_hash).collect();
match self.default_serving_preset {
None => presets.push(0),
_ => ()
}
presets
}
}