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

update typescript resizing type to match current imgproxy API #19

Closed
2 tasks
tibohei opened this issue Jul 5, 2023 · 1 comment
Closed
2 tasks

update typescript resizing type to match current imgproxy API #19

tibohei opened this issue Jul 5, 2023 · 1 comment

Comments

@tibohei
Copy link

tibohei commented Jul 5, 2023

The typescript type ResizingType does not match current imgproxy API definition. This should be corrected.

Expected Behavior

Typescript types should align with imgproxy API interface

Current Behavior

This library defines ResizingType as

export type ResizingType = 'fit' | 'fill' | 'crop';

The most recent imageproxy API documentation defines resizing_type as

Resizing type

Defines how imgproxy will resize the source image. Supported resizing types are:

  • fit: resizes the image while keeping aspect ratio to fit a given size.
  • fill: resizes the image while keeping aspect ratio to fill a given size and crops projecting parts.
  • fill-down: the same as fill, but if the resized image is smaller than the requested size, imgproxy will crop the result to keep the requested aspect ratio.
  • force: resizes the image without keeping the aspect ratio.
  • auto: if both source and resulting dimensions have the same orientation (portrait or landscape), imgproxy will use fill. Otherwise, it will use fit.

Default: fit

Possible Solution

  • Update type definitions in src/types.ts
  • review all other type definitions and compare with current imgproxy API definition
@tibohei tibohei changed the title update typescript resizing type to match current imgproxy update typescript resizing type to match current imgproxy API Jul 5, 2023
@remq
Copy link
Contributor

remq commented Sep 19, 2023

This repo isn't actively maintained anymore, but I just updated it to modernise it a bit (d3bbd16). I'm not a maintainer of the NPM repository, but I've asked for it to be deployed. This would include this change as well.

review all other type definitions and compare with current imgproxy API definition

Didn't have time to do this, but feel free to create a PR.

@remq remq closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants