Skip to content
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

Resize API #12

Open
SkyeHoefling opened this issue Sep 3, 2021 · 1 comment
Open

Resize API #12

SkyeHoefling opened this issue Sep 3, 2021 · 1 comment
Labels
⚒ Enhancement New feature or request

Comments

@SkyeHoefling
Copy link
Contributor

SkyeHoefling commented Sep 3, 2021

Description

Add ability to resize the primary image or thumbnail using the libheif native resize api.

New APIs

IImage

void Resize(int width, int height); // New API
void Resize(int widthAndHeight); // New API

Usage

The code below would generate a 200x200 square thumbnail. This use case is valuable for heic images that don't have an embedded thumbnail.

using (var image = new HeifImage("MyImage.heic"))
using (var primary = image.PrimaryImage())
{
  primary.Resize(200, 200);
  primary.Save("Output.jpeg", 90);
}
@SkyeHoefling
Copy link
Contributor Author

The resize api is only available after decoding an image. Adding resize will not provide us with a performance improvement on thumbnail generation as the decode operation still needs to be invoked.

// Currently, heif_scaling_options is not defined yet. Pass a NULL pointer.
LIBHEIF_API
struct heif_error heif_image_scale_image(const struct heif_image* input,
                                         struct heif_image** output,
                                         int width, int height,
                                         const struct heif_scaling_options* options);

@SkyeHoefling SkyeHoefling added the ⚒ Enhancement New feature or request label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚒ Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant