From eee3a79103be1ca58126bf69323be7ddc6179490 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:17:37 +0900 Subject: [PATCH 01/13] readibility ==> readability --- CHANGELOG.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index b004220..f057d3c 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 From c662856581a8c95665008254fb6cba23dca8b80d Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:17:51 +0900 Subject: [PATCH 02/13] performnace ==> performance --- CHANGELOG.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index f057d3c..f76a6e1 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -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 From 00e8f4d483c7d26542f60c4e3d37db80af4353d4 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:03 +0900 Subject: [PATCH 03/13] benchamrk ==> benchmark --- BENCHMARKING.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BENCHMARKING.rdoc b/BENCHMARKING.rdoc index d51476f..c9da273 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 From ef97afb5c8d75200f5ec7a0104a94fab22cbd2e9 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:17 +0900 Subject: [PATCH 04/13] shopuld ==> should --- spec/chunky_png/vector_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/chunky_png/vector_spec.rb b/spec/chunky_png/vector_spec.rb index bfdeeea..3e1b072 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 From 0af3911a0be47977b268dd3bd366b9dae9ee480b Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:27 +0900 Subject: [PATCH 05/13] mininum ==> minimum --- spec/chunky_png/vector_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/chunky_png/vector_spec.rb b/spec/chunky_png/vector_spec.rb index 3e1b072..cdb4a62 100644 --- a/spec/chunky_png/vector_spec.rb +++ b/spec/chunky_png/vector_spec.rb @@ -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 From b19129a9eacbfb31b2a953f84eb90fe96bd3568a Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:36 +0900 Subject: [PATCH 06/13] unkown ==> unknown --- spec/chunky_png/color_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/chunky_png/color_spec.rb b/spec/chunky_png/color_spec.rb index 10a0cd4..bb7acf2 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 From af228c35bd25ae1684976162515314d875124c8c Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:47 +0900 Subject: [PATCH 07/13] correcly ==> correctly --- spec/chunky_png/color_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/chunky_png/color_spec.rb b/spec/chunky_png/color_spec.rb index bb7acf2..29524fe 100644 --- a/spec/chunky_png/color_spec.rb +++ b/spec/chunky_png/color_spec.rb @@ -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" From 5a247837ffce53cf96f992f3846d230738c67fd4 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:18:57 +0900 Subject: [PATCH 08/13] oiginal ==> original --- spec/chunky_png/canvas/operations_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/chunky_png/canvas/operations_spec.rb b/spec/chunky_png/canvas/operations_spec.rb index 3eb7f60..e572d09 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 From 83c14df5c42abd393494cebb5a0b36744b532b57 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:19:40 +0900 Subject: [PATCH 09/13] cerate ==> create --- lib/chunky_png/palette.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chunky_png/palette.rb b/lib/chunky_png/palette.rb index 5231479..5bd56f5 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 From b3594a3b4bae59c7c988c0ef7dde235221ecba83 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:19:51 +0900 Subject: [PATCH 10/13] calcuated ==> calculated --- lib/chunky_png/color.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chunky_png/color.rb b/lib/chunky_png/color.rb index a96b793..69b60cb 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. From d70e6beb5afa96cb959c49bab65571ecdda5a69e Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:20:18 +0900 Subject: [PATCH 11/13] coeffient, coeffcient ==> coefficient --- lib/chunky_png/canvas/drawing.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/chunky_png/canvas/drawing.rb b/lib/chunky_png/canvas/drawing.rb index 11c3d7d..5f481bc 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 From 75a6f18af65481a25fd4a0b0097574118f5f93ac Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:20:34 +0900 Subject: [PATCH 12/13] modift ==> modify --- lib/chunky_png/canvas/operations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chunky_png/canvas/operations.rb b/lib/chunky_png/canvas/operations.rb index 98d069c..576ffc2 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 From d1d4253af044f7f999ef58fd1e9fbfe3859bb5e9 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 3 Jun 2024 19:22:09 +0900 Subject: [PATCH 13/13] indicies ==> indices --- lib/chunky_png/canvas/resampling.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/chunky_png/canvas/resampling.rb b/lib/chunky_png/canvas/resampling.rb index 9abeca6..24d7e7a 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]