mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Return input as is when there is no cropping to be done
This commit is contained in:
parent
2bf4fcd9bd
commit
c53db64e63
1 changed files with 3 additions and 0 deletions
|
@ -590,6 +590,9 @@ fn crop_image(
|
|||
// We're going to iterate over a pixel values array so we need integers
|
||||
let crop_rect = crop_rect.to_i32();
|
||||
let image_size = image_size.to_i32();
|
||||
if crop_rect == Rect::from_size(image_size) {
|
||||
return image_data;
|
||||
}
|
||||
// Assuming 4 bytes per pixel and row-major order for storage
|
||||
// (consecutive elements in a pixel row of the image are contiguous in memory)
|
||||
let stride = image_size.width * 4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue