fn load(input_folder: &str, frame_count: usize) -> Result<Self, Box<dyn Error>> {
        let mut result = {
            assert!(frame_count > 0);
            let (info, first_frame) = Frame::load(Path::new(&format!("{}/{:04}.png", input_folder, 1)))?;
            let mut result = Self {
                frames: Vec::new(),
                info: info
            };
            result.frames.push(first_frame);
            result
        };

        // TODO: multi-threading?
        for i in 2..=frame_count {
            let (info, frame) = Frame::load(Path::new(&format!("{}/{:04}.png", input_folder, i)))?;
            assert!(info.width == result.info.width);
            assert!(info.height == result.info.height);
            assert!(info.color_type == result.info.color_type);
            assert!(info.bit_depth == result.info.bit_depth);
            assert!(info.line_size == result.info.line_size);
            result.frames.push(frame);
        }

        Ok(result)
    }
// TODO: Movie::load doesn't tell where exactly things failed
:load doesn't tell where exactly things failed
: load doesn ' t tell where exactly things failed
fn load(input_folder: &str, frame_count: usize) -> Result<Self, Box<dyn Error>> {
        let mut result = {
            assert!(frame_count > 0);
            let (info, first_frame) = Frame::load(Path::new(&format!("{}/{:04}.png", input_folder, 1)))?;
            let mut result = Self {
                frames: Vec::new(),
                info: info
            };
            result.frames.push(first_frame);
            result
        };
        // TODO: multi-threading?
        for i in 2..=frame_count {
            let (info, frame) = Frame::load(Path::new(&format!("{}/{:04}.png", input_folder, i)))?;
            assert!(info.width == result.info.width);
            assert!(info.height == result.info.height);
            assert!(info.color_type == result.info.color_type);
            assert!(info.bit_depth == result.info.bit_depth);
            assert!(info.line_size == result.info.line_size);
            result.frames.push(frame);
        }
        Ok(result)
    }
fn load ( input_folder : & str , frame_count : usize ) -> Result < Self , Box < dyn Error > > { let mut result = { assert ! ( frame_count 0 ) ; let ( info , first_frame ) = Frame :: load ( Path :: new ( & format ! ( " " input_folder 1 ) ) ) ? ; let mut result = Self { frames : Vec :: new ( ) , info : info } ; result . frames . push ( first_frame ) ; result } ; // TODO: multi-threading? for i in 2 ..= frame_count { let ( info , frame ) = Frame :: load ( Path :: new ( & format ! ( " " input_folder i ) ) ) ? ; assert ! ( info width result info width ) ; assert ! ( info height result info height ) ; assert ! ( info color_type result info color_type ) ; assert ! ( info bit_depth result info bit_depth ) ; assert ! ( info line_size result info line_size ) ; result . frames . push ( frame ) ; } Ok ( result ) }
TODO: Movie::load doesn't tell where exactly things failed
TODO : Movie :: load doesn ' t tell where exactly things failed
input_folder
&str
frame_count
usize
input_folder
&str
frame_count
usize