silverstripe / silverstripe-asset-admin

Silverstripe assets gallery for asset management
BSD 3-Clause "New" or "Revised" License
20 stars 79 forks source link

ENH Allow developers to decide if resampling is needed #1252

Closed leochenftw closed 2 years ago

leochenftw commented 2 years ago

Sometimes, you just don't need the CMS to resample the images (e.g. when using S3 module + lambda resizing)

GuySartorelli commented 2 years ago

It would be great to see a companion PR in silverstripe/silverstripe-assets to add this config variable with a default value and PHPdoc, and a unit test added to this PR.

Looks like a useful optimisation for the use case you pointed out. 👍

leochenftw commented 2 years ago

thanks, @GuySartorelli for your feedback.

Ideally, the default config value should be added under https://github.com/silverstripe/silverstripe-assets, but, it will look confusing if I submit a PR with no_resample config variable alone over there without the context.

So maybe SS could add that officially?

GuySartorelli commented 2 years ago

Ideally, the default config value should be added under https://github.com/silverstripe/silverstripe-assets, but, it will look confusing if I submit a PR with no_resample config variable alone over there without the context.

If you mention in that PR that it is for this one then they'll be treated together.

leochenftw commented 2 years ago

corresponding PR made on SS Assets module, at https://github.com/silverstripe/silverstripe-assets/pull/479

michalkleiner commented 2 years ago

I've commented on the admin PR. We need to change the name around to reflect the default and then update this PR to reflect that. Happy to merge both when the changes are addressed.

leochenftw commented 2 years ago

thanks, @michalkleiner . I've made the changes as you suggested.

Cheers

michalkleiner commented 2 years ago

Looking good now @leochenftw. Can you please swap the order of the conditions on one of the touched rows and then squash your commits into one "ENH Allow developers to decide if resampling is needed". I'll be happy to merge it after that.

leochenftw commented 2 years ago

thanks @michalkleiner - is it possible for you to do the squash upon merge? I recently returned the laptop that I was doing the dev work on, so it will be easier to do it that way

michalkleiner commented 2 years ago

Thanks for helping with the squash, Dan, I need to look myself into how to push to fork's PR branches.

dhensby commented 2 years ago

@michalkleiner as long as the contributor has allowed maintainers to push to their PRs it's as simple as git p [-f] https://github.com/their/repo HEAD:their-branch