Skip to content

Commit

Permalink
fix: 命名修正
Browse files Browse the repository at this point in the history
  • Loading branch information
PigeonsHouse committed Jan 6, 2025
1 parent 00f9fcd commit 4316cab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vsml_core/src/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub enum ObjectType<I, A> {
pub trait ObjectProcessor<I, A> {
fn name(&self) -> &str;
fn default_duration(&self, attributes: &HashMap<String, String>) -> f64;
fn default_size(&self, attributes: &HashMap<String, String>) -> (f32, f32);
fn default_image_size(&self, attributes: &HashMap<String, String>) -> (f32, f32);
fn process_image(
&self,
render_sec: f64,
Expand Down
2 changes: 1 addition & 1 deletion vsml_iv_converter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ fn convert_tag_element<'a, I, A>(
let mut rule_target_duration = None;
let mut target_size: (f32, f32) = match &object_type {
ObjectType::Wrap => (0.0, 0.0),
ObjectType::Other(processor) => processor.default_size(attributes),
ObjectType::Other(processor) => processor.default_image_size(attributes),
};

let mut order: Order = match name {
Expand Down
2 changes: 1 addition & 1 deletion vsml_processer/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<I> ObjectProcessor<I, VsmlAudio> for AudioProcessor {
reader.duration() as f64 / reader.spec().sample_rate as f64
}

fn default_size(&self, _attributes: &HashMap<String, String>) -> (f32, f32) {
fn default_image_size(&self, _attributes: &HashMap<String, String>) -> (f32, f32) {
(0.0, 0.0)
}

Expand Down
2 changes: 1 addition & 1 deletion vsml_processer/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl<A> ObjectProcessor<VsmlImage, A> for ImageProcessor {
f64::INFINITY
}

fn default_size(&self, attributes: &HashMap<String, String>) -> (f32, f32) {
fn default_image_size(&self, attributes: &HashMap<String, String>) -> (f32, f32) {
let src_path = attributes.get("src").unwrap();
let image = image::open(src_path).unwrap();
(image.width() as f32, image.height() as f32)
Expand Down

0 comments on commit 4316cab

Please sign in to comment.