Skip to content

Commit

Permalink
fix: prevents read_lines_by_block from skipping pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
caiubi authored Nov 18, 2024
2 parents 9cfa9c3 + c78d4d5 commit 8c6aa87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/gdal/extensions/raster_band/io_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def read_lines_by_block
return enum_for(:read_lines_by_block) unless block_given?

read_blocks_by_block do |pixels, x_block_size, y_block_size|
pixels.each_slice(x_block_size).with_index do |row, block_row_number|
yield row
pixels.each_slice(block_size[:x]).with_index do |row, block_row_number|
yield row.take(x_block_size)
break if block_row_number == y_block_size - 1
end
end
Expand Down

0 comments on commit 8c6aa87

Please sign in to comment.