Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add KeyCDN support#43

Merged
ascorbic merged 3 commits into
ascorbic:mainfrom
tiptenbrink:main
Apr 4, 2023
Merged

feat: add KeyCDN support#43
ascorbic merged 3 commits into
ascorbic:mainfrom
tiptenbrink:main

Conversation

@tiptenbrink

Copy link
Copy Markdown
Contributor

Hi! This should add support for KeyCDN to unpic. Let me know if anything's missing from the tests / code.

Comment thread src/parse.ts Outdated
@ascorbic

ascorbic commented Apr 2, 2023

Copy link
Copy Markdown
Owner

Great. Just one copy+paste error. Also, could you add a sample image to the end of the list in examples.json? Thanks!

@tiptenbrink

Copy link
Copy Markdown
Contributor Author

Great. Just one copy+paste error. Also, could you add a sample image to the end of the list in examples.json? Thanks!

@ascorbic Ah apologies about that! I think everything should be good now. One question though, should it always center the crop if the width/height don't match the image aspect ratio? By default it doesn't do that on KeyCDN but I could change it so that would be the default behavior.

@ascorbic

ascorbic commented Apr 4, 2023

Copy link
Copy Markdown
Owner

That's great, thanks! The current cropping approach looks great. The only improvement would be, if it supports it, prevent up-scaling images. Generally the approach we want for the default behaviour is:

  • maintain aspect ratio (this is required)
  • use "cover" strategy (i.e. the image is cropped to fit the aspect ratio, rather than padded. also required)
  • use the CDN's "best" focus strategy. Some have smart cropping. The current behaviour looks good.
  • no upscaling. better to do that in the browser

@ascorbic ascorbic merged commit 0cfde2e into ascorbic:main Apr 4, 2023
@mixie-bot mixie-bot Bot mentioned this pull request Apr 4, 2023
@mixie-bot mixie-bot Bot mentioned this pull request Dec 7, 2024
@mixie-bot mixie-bot Bot mentioned this pull request Dec 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants