Skip to content

Commit fe6d53a

Browse files
authored
Merge pull request #36 from RunDevelopment/quality-setter
Add quality getter and setter to `Encoder`
2 parents f7def12 + cec007f commit fe6d53a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/encoder.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ impl<W: JfifWrite> Encoder<W> {
297297
self.density
298298
}
299299

300+
/// Set quality setting. Quality must be between 1 and 100 where 100 is the highest image quality.
301+
pub fn set_quality(&mut self, quality: u8) {
302+
self.quality = quality;
303+
}
304+
305+
/// Get quality setting
306+
pub fn quality(&self) -> u8 {
307+
self.quality
308+
}
309+
300310
/// Set chroma subsampling factor
301311
pub fn set_sampling_factor(&mut self, sampling: SamplingFactor) {
302312
self.sampling_factor = sampling;

0 commit comments

Comments
 (0)