Skip to content

Commit

Permalink
Merge pull request #100 from bboshoven/master
Browse files Browse the repository at this point in the history
Get pixels relative to x1 and y1 on source image
  • Loading branch information
silvia-odwyer authored Jun 30, 2021
2 parents 114ae53 + 98674b0 commit 35adb2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crate/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn crop(
let mut cropped_img: RgbaImage = ImageBuffer::new(x2 - x1, y2 - y1);

for (x, y) in ImageIterator::with_dimension(&cropped_img.dimensions()) {
let px = img.get_pixel(x, y);
let px = img.get_pixel(x1 + x, y1 + y);
cropped_img.put_pixel(x, y, px);
}
let dynimage = ImageRgba8(cropped_img);
Expand Down

0 comments on commit 35adb2c

Please sign in to comment.