diff --git a/BENCHMARKING.rdoc b/BENCHMARKING.rdoc
index d51476f9..c9da2734 100644
--- a/BENCHMARKING.rdoc
+++ b/BENCHMARKING.rdoc
@@ -21,7 +21,7 @@ make sure that the chunky_png is installed for all your interpreters.
What is a speed improvement on one interpreter doesn't necessarily mean the
performance will be better on other interpreters as well. Please make sure to
-benchamrk different RUby interpreters. When it comes to different Ruby
+benchmark different RUby interpreters. When it comes to different Ruby
interpreters, the priority is the performance on recent MRI versions.
Some very old benchmark result (using N=50) on my 2007 iMac can be
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
index b0042207..f76a6e1f 100644
--- a/CHANGELOG.rdoc
+++ b/CHANGELOG.rdoc
@@ -82,7 +82,7 @@ The file documents the changes to this library over the different versions.
- Improve performance of Palette.from_canvas.
- Add Color.euclidean_distance_rgba to compare colors.
- Bugix in Canvas.from_bgr_stream.
-- Documentation and code readibility improvements.
+- Documentation and code readability improvements.
- README updates, include mention of screencast.
=== 1.3.0 - 2014-02-10
@@ -105,7 +105,7 @@ The file documents the changes to this library over the different versions.
=== 1.2.7 - 2013-01-07
-- Small PNG decoding performnace improvements by using bitwise math.
+- Small PNG decoding performance improvements by using bitwise math.
=== 1.2.6 - 2012-08-07
diff --git a/lib/chunky_png/canvas/drawing.rb b/lib/chunky_png/canvas/drawing.rb
index 11c3d7d0..5f481bc4 100644
--- a/lib/chunky_png/canvas/drawing.rb
+++ b/lib/chunky_png/canvas/drawing.rb
@@ -303,11 +303,11 @@ def circle(x0, y0, radius, stroke_color = ChunkyPNG::Color::BLACK, fill_color =
# Calculates the binomial coefficient for n over k.
#
- # @param [Integer] n first parameter in coeffient (the number on top when
+ # @param [Integer] n first parameter in coefficient (the number on top when
# looking at the mathematic formula)
- # @param [Integer] k k-element, second parameter in coeffient (the number
+ # @param [Integer] k k-element, second parameter in coefficient (the number
# on the bottom when looking at the mathematic formula)
- # @return [Integer] The binomial coeffcient of (n,k)
+ # @return [Integer] The binomial coefficient of (n,k)
def binomial_coefficient(n, k)
return 1 if n == k || k == 0
return n if k == 1
diff --git a/lib/chunky_png/canvas/operations.rb b/lib/chunky_png/canvas/operations.rb
index 98d069cc..576ffc25 100644
--- a/lib/chunky_png/canvas/operations.rb
+++ b/lib/chunky_png/canvas/operations.rb
@@ -26,7 +26,7 @@ def grayscale!
# Converts the canvas to grayscale, returning a new canvas.
#
- # This method will not modify the canvas. To modift the current canvas,
+ # This method will not modify the canvas. To modify the current canvas,
# use {#grayscale!} instead.
#
# @return [ChunkyPNG::Canvas] A copy of the canvas, converted to
diff --git a/lib/chunky_png/canvas/resampling.rb b/lib/chunky_png/canvas/resampling.rb
index 9abeca6b..24d7e7a4 100644
--- a/lib/chunky_png/canvas/resampling.rb
+++ b/lib/chunky_png/canvas/resampling.rb
@@ -12,19 +12,19 @@ class Canvas
module Resampling
# Integer Interpolation between two values
#
- # Used for generating indicies for interpolation (eg, nearest
+ # Used for generating indices for interpolation (eg, nearest
# neighbour).
#
# @param [Integer] width The width of the source
# @param [Integer] new_width The width of the destination
- # @return [Array] An Array of Integer indicies
+ # @return [Array] An Array of Integer indices
def steps(width, new_width)
- indicies, residues = steps_residues(width, new_width)
+ indices, residues = steps_residues(width, new_width)
for i in 1..new_width
- indicies[i - 1] = (indicies[i - 1] + (residues[i - 1] + 127) / 255)
+ indices[i - 1] = (indices[i - 1] + (residues[i - 1] + 127) / 255)
end
- indicies
+ indices
end
# Fractional Interpolation between two values
@@ -34,9 +34,9 @@ def steps(width, new_width)
#
# @param [Integer] width The width of the source
# @param [Integer] new_width The width of the destination
- # @return [Array, Array] Two arrays of indicies and residues
+ # @return [Array, Array] Two arrays of indices and residues
def steps_residues(width, new_width)
- indicies = Array.new(new_width, nil)
+ indices = Array.new(new_width, nil)
residues = Array.new(new_width, nil)
# This works by accumulating the fractional error and
@@ -53,7 +53,7 @@ def steps_residues(width, new_width)
err = (width - new_width) % denominator
for i in 1..new_width
- indicies[i - 1] = index
+ indices[i - 1] = index
residues[i - 1] = (255.0 * err.to_f / denominator.to_f).round
index += base_step
@@ -64,7 +64,7 @@ def steps_residues(width, new_width)
end
end
- [indicies, residues]
+ [indices, residues]
end
# Resamples the canvas using nearest neighbor interpolation.
@@ -102,13 +102,13 @@ def resample_bilinear!(new_width, new_height)
pixels = Array.new(new_width * new_height)
i = 0
for y in 1..new_height
- # Clamp the indicies to the edges of the image
+ # Clamp the indices to the edges of the image
y1 = [index_y[y - 1], 0].max
y2 = [index_y[y - 1] + 1, height - 1].min
y_residue = interp_y[y - 1]
for x in 1..new_width
- # Clamp the indicies to the edges of the image
+ # Clamp the indices to the edges of the image
x1 = [index_x[x - 1], 0].max
x2 = [index_x[x - 1] + 1, width - 1].min
x_residue = interp_x[x - 1]
diff --git a/lib/chunky_png/color.rb b/lib/chunky_png/color.rb
index a96b793b..69b60cbe 100644
--- a/lib/chunky_png/color.rb
+++ b/lib/chunky_png/color.rb
@@ -443,7 +443,7 @@ def grayscale_teint(color)
# channel.
#
# This method will return a full color value, with the R, G, and B value
- # set to the grayscale teint calcuated from the input color's R, G and B
+ # set to the grayscale teint calculated from the input color's R, G and B
# values.
#
# @param [Integer] color The color to convert.
diff --git a/lib/chunky_png/palette.rb b/lib/chunky_png/palette.rb
index 5231479a..5bd56f59 100644
--- a/lib/chunky_png/palette.rb
+++ b/lib/chunky_png/palette.rb
@@ -30,7 +30,7 @@ def initialize(enum, decoding_map = nil)
# Builds a palette instance from a PLTE chunk and optionally a tRNS chunk
# from a PNG datastream.
#
- # This method will cerate a palette that is suitable for decoding an image.
+ # This method will create a palette that is suitable for decoding an image.
#
# @param palette_chunk [ChunkyPNG::Chunk::Palette] The palette chunk to
# load from
diff --git a/spec/chunky_png/canvas/operations_spec.rb b/spec/chunky_png/canvas/operations_spec.rb
index 3eb7f601..e572d09d 100644
--- a/spec/chunky_png/canvas/operations_spec.rb
+++ b/spec/chunky_png/canvas/operations_spec.rb
@@ -41,7 +41,7 @@
expect { subject.crop(10, 5, 4, 8) }.to_not change { subject.pixels }
end
- it "should raise an exception when the cropped image falls outside the oiginal image" do
+ it "should raise an exception when the cropped image falls outside the original image" do
expect { subject.crop(16, 16, 2, 2) }.to raise_error(ChunkyPNG::OutOfBounds)
end
end
diff --git a/spec/chunky_png/color_spec.rb b/spec/chunky_png/color_spec.rb
index 10a0cd49..29524fe2 100644
--- a/spec/chunky_png/color_spec.rb
+++ b/spec/chunky_png/color_spec.rb
@@ -206,7 +206,7 @@
expect(html_color("Spring green @ 0.0")).to eql 0x00ff7f00
end
- it "should raise for an unkown color name" do
+ it "should raise for an unknown color name" do
expect { html_color(:nonsense) }.to raise_error(ArgumentError)
end
end
@@ -252,7 +252,7 @@
end
describe "#to_hex" do
- it "should represent colors correcly using hex notation" do
+ it "should represent colors correctly using hex notation" do
expect(to_hex(@white)).to eql "#ffffffff"
expect(to_hex(@black)).to eql "#000000ff"
expect(to_hex(@opaque)).to eql "#0a6496ff"
@@ -260,7 +260,7 @@
expect(to_hex(@fully_transparent)).to eql "#0a649600"
end
- it "should represent colors correcly using hex notation without alpha channel" do
+ it "should represent colors correctly using hex notation without alpha channel" do
expect(to_hex(@white, false)).to eql "#ffffff"
expect(to_hex(@black, false)).to eql "#000000"
expect(to_hex(@opaque, false)).to eql "#0a6496"
diff --git a/spec/chunky_png/vector_spec.rb b/spec/chunky_png/vector_spec.rb
index bfdeeea2..cdb4a62e 100644
--- a/spec/chunky_png/vector_spec.rb
+++ b/spec/chunky_png/vector_spec.rb
@@ -6,7 +6,7 @@
it { should respond_to(:points) }
describe "#length" do
- it "shopuld have 3 items" do
+ it "should have 3 items" do
expect(subject.length).to eql(3)
end
end
@@ -52,7 +52,7 @@
expect(subject.offset).to be_kind_of(ChunkyPNG::Point)
end
- it "should use the mininum x and y coordinates as values for the point" do
+ it "should use the minimum x and y coordinates as values for the point" do
expect(subject.offset.x).to eql subject.min_x
expect(subject.offset.y).to eql subject.min_y
end