Skip to content

Commit

Permalink
Change the minimum frame size from 16x16 to 1x1 for still picture mode
Browse files Browse the repository at this point in the history
If still picture mode, allow smaller than 16x16 image frame size, i.e. <= 15x15.
  • Loading branch information
ycho authored and lu-zero committed Nov 11, 2020
1 parent 8d86097 commit 625a2bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/api/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,16 @@ impl Config {

let config = &self.enc;

if config.width < 16 || config.width > u16::max_value() as usize {
if (config.still_picture && config.width < 1)
|| (!config.still_picture && config.width < 16)
|| config.width > u16::max_value() as usize
{
return Err(InvalidWidth(config.width));
}
if config.height < 16 || config.height > u16::max_value() as usize {
if (config.still_picture && config.height < 1)
|| (!config.still_picture && config.height < 16)
|| config.height > u16::max_value() as usize
{
return Err(InvalidHeight(config.height));
}

Expand Down

0 comments on commit 625a2bb

Please sign in to comment.