lib/chunky_png/canvas/operations.rb in chunky_png-1.2.8 vs lib/chunky_png/canvas/operations.rb in chunky_png-1.2.9
- old
+ new
@@ -151,12 +151,11 @@
# @param [Integer] crop_height The height of the image to be cropped.
# @return [ChunkyPNG::Canvas] Returns itself, but cropped.
# @raise [ChunkyPNG::OutOfBounds] when the crop dimensions plus the given coordinates
# are bigger then the original image.
def crop!(x, y, crop_width, crop_height)
-
- raise ChunkyPNG::OutOfBounds, "Image width is too small!" if crop_width + x > width
- raise ChunkyPNG::OutOfBounds, "Image width is too small!" if crop_height + y > height
+ raise ChunkyPNG::OutOfBounds, "Original image width is too small!" if crop_width + x > width
+ raise ChunkyPNG::OutOfBounds, "Original image height is too small!" if crop_height + y > height
new_pixels = []
for cy in 0...crop_height do
new_pixels += pixels.slice((cy + y) * width + x, crop_width)
end