diff --git a/src/codecs/avif/decoder.rs b/src/codecs/avif/decoder.rs index 15cb5e1344..24a87e25ad 100644 --- a/src/codecs/avif/decoder.rs +++ b/src/codecs/avif/decoder.rs @@ -190,7 +190,7 @@ fn reshape_plane( return Ok(vec![]); } - // Except for an empty image a true stride is required.. + // Except for an empty image a true stride is required. if stride == 0 { return Err(error_map(AvifDecoderError::InvalidStride(stride))); } diff --git a/src/codecs/bmp/decoder.rs b/src/codecs/bmp/decoder.rs index cba61aed68..0999c8d819 100644 --- a/src/codecs/bmp/decoder.rs +++ b/src/codecs/bmp/decoder.rs @@ -752,7 +752,7 @@ fn check_for_overflow(width: i32, length: i32, channels: usize) -> ImageResult<( }) } -/// Calculate how many many bytes a buffer holding a decoded image with these properties would +/// Calculate how many bytes a buffer holding a decoded image with these properties would /// require. Returns `None` if the buffer size would overflow or if one of the sizes are negative. fn num_bytes(width: i32, length: i32, channels: usize) -> Option { if width <= 0 || length <= 0 { diff --git a/src/codecs/hdr/decoder.rs b/src/codecs/hdr/decoder.rs index 20835bb2fe..59ca988e17 100644 --- a/src/codecs/hdr/decoder.rs +++ b/src/codecs/hdr/decoder.rs @@ -449,7 +449,7 @@ fn decode_old_rle(r: &mut R, fb: Rgbe8Pixel, buf: &mut [Rgbe8Pixel]) -> let mut prev_pixel = fb; while x_off < width { let pix = read_rgbe(r)?; - // it's harder to forget to increase x_off if I write this this way. + // it's harder to forget to increase x_off if I write this way. x_off += { if let Some(rl) = rl_marker(pix) { if rl_shift >= 32 { diff --git a/src/codecs/pnm/encoder.rs b/src/codecs/pnm/encoder.rs index 1172ef0c60..c6e3fe5fe3 100644 --- a/src/codecs/pnm/encoder.rs +++ b/src/codecs/pnm/encoder.rs @@ -407,7 +407,7 @@ impl<'a> UncheckedHeader<'a> { impl<'a> CheckedDimensions<'a> { // Check color compatibility with the header. This will only error when we are certain that // the combination is bogus (e.g. combining Pixmap and Palette) but allows uncertain - // combinations (basically a ArbitraryTuplType::Custom with any color of fitting depth). + // combinations (basically an ArbitraryTuplType::Custom with any color of fitting depth). fn check_header_color(self, color: ExtendedColorType) -> ImageResult> { let components = u32::from(color.channel_count()); diff --git a/src/codecs/tga/encoder.rs b/src/codecs/tga/encoder.rs index 6a65d164cb..e017fd7922 100644 --- a/src/codecs/tga/encoder.rs +++ b/src/codecs/tga/encoder.rs @@ -291,7 +291,7 @@ mod tests { assert_eq!(*err, EncoderError::WidthInvalid(dimension)); } other => panic!( - "Encoding an image that is too wide should return a InvalidWidth \ + "Encoding an image that is too wide should return an InvalidWidth \ it returned {other:?} instead" ), } @@ -320,7 +320,7 @@ mod tests { assert_eq!(*err, EncoderError::HeightInvalid(dimension)); } other => panic!( - "Encoding an image that is too tall should return a InvalidHeight \ + "Encoding an image that is too tall should return an InvalidHeight \ it returned {other:?} instead" ), } diff --git a/src/imageops/colorops.rs b/src/imageops/colorops.rs index 08b1651bbb..ecb9281376 100644 --- a/src/imageops/colorops.rs +++ b/src/imageops/colorops.rs @@ -385,7 +385,7 @@ pub trait ColorMap { /// cmap.lookup(p.0[0] as usize) /// .expect("indexed color out-of-range") /// }); -/// // Create an black and white image of expected output. +/// // Create a black and white image of expected output. /// let bw = ImageBuffer::from_fn(w, h, |x, y| -> Luma { /// if x <= (w / 2) { /// [0].into() diff --git a/src/images/buffer.rs b/src/images/buffer.rs index b7f0f0f7e1..271c3f0cc6 100644 --- a/src/images/buffer.rs +++ b/src/images/buffer.rs @@ -664,7 +664,7 @@ where SampleLayout::row_major_packed(

::CHANNEL_COUNT, self.width, self.height) } - /// Return the raw sample buffer with its stride an dimension information. + /// Return the raw sample buffer with its stride and dimension information. /// /// The returned buffer is guaranteed to be well formed in all cases. It is laid out by /// colors, width then height, meaning `channel_stride <= width_stride <= height_stride`. All @@ -1096,7 +1096,7 @@ impl ImageBuffer { /// Set primaries and transfer characteristics from a Cicp color space. /// - /// Returns an error if `cicp` uses features that are not support with an RGB color space, e.g. + /// Returns an error if `cicp` uses features that are not supported with an RGB color space, e.g. /// a matrix or narrow range (studio encoding) channels. pub fn set_color_space(&mut self, cicp: Cicp) -> ImageResult<()> { self.color = cicp.try_into_rgb()?; diff --git a/src/images/dynimage.rs b/src/images/dynimage.rs index 594325dd56..df4a3c93a1 100644 --- a/src/images/dynimage.rs +++ b/src/images/dynimage.rs @@ -650,7 +650,7 @@ impl DynamicImage { } } - /// Return a reference to an 16bit RGB image + /// Return a reference to a 16bit RGB image #[must_use] pub fn as_rgb16(&self) -> Option<&Rgb16Image> { match *self { @@ -659,7 +659,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 16bit RGB image + /// Return a mutable reference to a 16bit RGB image pub fn as_mut_rgb16(&mut self) -> Option<&mut Rgb16Image> { match *self { DynamicImage::ImageRgb16(ref mut p) => Some(p), @@ -667,7 +667,7 @@ impl DynamicImage { } } - /// Return a reference to an 16bit RGBA image + /// Return a reference to a 16bit RGBA image #[must_use] pub fn as_rgba16(&self) -> Option<&Rgba16Image> { match *self { @@ -676,7 +676,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 16bit RGBA image + /// Return a mutable reference to a 16bit RGBA image pub fn as_mut_rgba16(&mut self) -> Option<&mut Rgba16Image> { match *self { DynamicImage::ImageRgba16(ref mut p) => Some(p), @@ -684,7 +684,7 @@ impl DynamicImage { } } - /// Return a reference to an 32bit RGB image + /// Return a reference to a 32bit RGB image #[must_use] pub fn as_rgb32f(&self) -> Option<&Rgb32FImage> { match *self { @@ -693,7 +693,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 32bit RGB image + /// Return a mutable reference to a 32bit RGB image pub fn as_mut_rgb32f(&mut self) -> Option<&mut Rgb32FImage> { match *self { DynamicImage::ImageRgb32F(ref mut p) => Some(p), @@ -701,7 +701,7 @@ impl DynamicImage { } } - /// Return a reference to an 32bit RGBA image + /// Return a reference to a 32bit RGBA image #[must_use] pub fn as_rgba32f(&self) -> Option<&Rgba32FImage> { match *self { @@ -710,7 +710,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 32bit RGBA image + /// Return a mutable reference to a 32bit RGBA image pub fn as_mut_rgba32f(&mut self) -> Option<&mut Rgba32FImage> { match *self { DynamicImage::ImageRgba32F(ref mut p) => Some(p), @@ -718,7 +718,7 @@ impl DynamicImage { } } - /// Return a reference to an 16bit Grayscale image + /// Return a reference to a 16bit Grayscale image #[must_use] pub fn as_luma16(&self) -> Option<&Gray16Image> { match *self { @@ -727,7 +727,7 @@ impl DynamicImage { } } - /// Return a reference to an 32bit Grayscale image + /// Return a reference to a 32bit Grayscale image #[must_use] pub fn as_luma32f(&self) -> Option<&Gray32FImage> { match *self { @@ -736,7 +736,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 16bit Grayscale image + /// Return a mutable reference to a 16bit Grayscale image pub fn as_mut_luma16(&mut self) -> Option<&mut Gray16Image> { match *self { DynamicImage::ImageLuma16(ref mut p) => Some(p), @@ -744,7 +744,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 32bit Grayscale image + /// Return a mutable reference to a 32bit Grayscale image #[must_use] pub fn as_mut_luma32f(&mut self) -> Option<&mut Gray32FImage> { match *self { @@ -753,7 +753,7 @@ impl DynamicImage { } } - /// Return a reference to an 16bit Grayscale image with an alpha channel + /// Return a reference to a 16bit Grayscale image with an alpha channel #[must_use] pub fn as_luma_alpha16(&self) -> Option<&GrayAlpha16Image> { match *self { @@ -762,7 +762,7 @@ impl DynamicImage { } } - /// Return a reference to an 32bit Grayscale image with an alpha channel + /// Return a reference to a 32bit Grayscale image with an alpha channel pub fn as_luma_alpha32f(&self) -> Option<&GrayAlpha32FImage> { match *self { DynamicImage::ImageLumaA32F(ref p) => Some(p), @@ -770,7 +770,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 16bit Grayscale image with an alpha channel + /// Return a mutable reference to a 16bit Grayscale image with an alpha channel pub fn as_mut_luma_alpha16(&mut self) -> Option<&mut GrayAlpha16Image> { match *self { DynamicImage::ImageLumaA16(ref mut p) => Some(p), @@ -778,7 +778,7 @@ impl DynamicImage { } } - /// Return a mutable reference to an 32bit Grayscale image with an alpha channel + /// Return a mutable reference to a 32bit Grayscale image with an alpha channel pub fn as_mut_luma_alpha32f(&mut self) -> Option<&mut GrayAlpha32FImage> { match *self { DynamicImage::ImageLumaA32F(ref mut p) => Some(p), @@ -947,7 +947,7 @@ impl DynamicImage { /// Set primaries and transfer characteristics from a Cicp color space. /// - /// Returns an error if `cicp` uses features that are not support with an RGB color space, e.g. + /// Returns an error if `cicp` uses features that are not supported with an RGB color space, e.g. /// a matrix or narrow range (studio encoding) channels. pub fn set_color_space(&mut self, cicp: Cicp) -> ImageResult<()> { dynamic_map!(self, ref mut p, p.set_color_space(cicp)) diff --git a/src/images/generic_image.rs b/src/images/generic_image.rs index 6e8c5b71ed..8fcaabacfe 100644 --- a/src/images/generic_image.rs +++ b/src/images/generic_image.rs @@ -155,7 +155,7 @@ pub struct Pixels<'a, I: ?Sized + 'a> { image: &'a I, /// Maintains `x < self.width` with a non-empty image. x: u32, - /// Maintains `y <= self.height` and `self.height == 0` with an empty image.. + /// Maintains `y <= self.height` and `self.height == 0` with an empty image. y: u32, width: u32, height: u32, diff --git a/src/metadata/moxcms.rs b/src/metadata/moxcms.rs index 9f02b0783b..59fb2a6299 100644 --- a/src/metadata/moxcms.rs +++ b/src/metadata/moxcms.rs @@ -378,7 +378,7 @@ impl Moxcms { /// This is the whole input information which we must be able to pass to the CMS in a support /// transform, to handle all possible combinations of `ColorType` pixels that can be thrown at us. /// For instance, in a previous iteration we had a separate gray profile here (but now handle that -/// internally by expansion to RGB through an YCbCr). Future iterations may add additional structs +/// internally by expansion to RGB through a YCbCr). Future iterations may add additional structs /// to be computed for validating `CicpTransform::new`. struct ColorProfile { rgb: moxcms::ColorProfile, @@ -396,7 +396,7 @@ impl ColorProfile { } impl Cicp { - /// Get an compute representation of an ICC profile for RGB. + /// Get a compute representation of an ICC profile for RGB. /// /// Note you should *not* be using this profile for export in a file, as discussed below. ///