-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Image Resizing #97
Comments
I try
|
Did you see #71 (comment)? |
This: |
Thanks! |
I'd avoid |
What would be the thing to use in its place? Oh wait, I see in the examples that it mentions to use ThumbnailBuffer: https://github.com/kleisauke/net-vips/blob/master/samples/NetVips.Samples/Samples/ThumbnailPipeline.cs#L211 |
You can use the various -using var image = Image.NewFromFile(Filename, access: Enums.Access.Sequential);
-
// `vips_thumbnail` resize behavior is based on a square bounding box.
// To resize along a specific axis, pass a huge value to the opposite axis.
// See: https://github.com/libvips/libvips/pull/1639
-using var thumb = image.ThumbnailImage(300, height: 10000000);
+using var thumb = Image.Thumbnail(Filename, 300, height: 10000000);
thumb.WriteToFile("thumbnail.jpg"); -using var image = Image.NewFromBuffer(Buffer, access: Enums.Access.Sequential);
-using var thumb = image.ThumbnailImage(300, height: 10000000);
+using var thumb = Image.ThumbnailBuffer(Buffer, 300, height: 10000000);
thumb.WriteToFile("thumbnail.jpg"); -using var image = Image.NewFromStream(Stream, access: Enums.Access.Sequential);
-using var thumb = image.ThumbnailImage(300, height: 10000000);
+using var thumb = Image.ThumbnailStream(Stream, 300, height: 10000000);
thumb.WriteToFile("thumbnail.jpg"); |
According to docs, there is a Resize function that changes image dimensions based on scale ratio. But what if I want to change dimensions by giving width and height values, which function should I use?
The text was updated successfully, but these errors were encountered: