-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how do you apply a crop on the target buffer? #31
Comments
view.set_crop_box(crop)?;
let mut target_view = if resize_dims != output_dims {
target_image.view_mut().crop(left, top, width, height)?
} else {
target_image.view_mut()
};
resizer.resize(&view, &mut target_view)?; |
In the new version you have to use use fast_image_resize::images::CroppedImageMut;
let mut cropped_dst_image = CroppedImageMut::new(
&mut dst_image,
dst_left,
dst_top,
dst_width,
dst_height,
).unwrap();
let mut resizer = fr::Resizer::new();
resizer
.resize(
&src_image,
&mut cropped_dst_image,
&ResizeOptions::new().crop(src_left, src_top, src_width, src_height),
)
.unwrap(); |
I see thank you, is there a difference to applying a crop on the resize options vs submitting a CroppedImage as the source? |
ResizeOptions uses |
Previously in older versions we used to be able to provide a crop on both the input and output buffer in the resize function.
if i want to take a subsection of a source image and then impose it upon the dest image at a different sub section.
The text was updated successfully, but these errors were encountered: