-
Notifications
You must be signed in to change notification settings - Fork 184
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
feature(thumbnails): add the ability to define custom image processors #7409
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
c59d8b1
to
148ff7a
Compare
@fschade pls add your description to the readme of the thumbnail service, thx |
a34649a
to
a514837
Compare
Co-authored-by: Martin <github@diemattels.at>
LGTM from a docs pov 👍 |
SonarCloud Quality Gate failed. 2 Bugs 60.6% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Returned: 15x10 | ||
Requested: 18x12 | ||
Available: 30x20, 15x10, 9x6 | ||
Returned: 15x10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it return the next-smaller instead of the next-bigger resolution? Would look nicer if clients down-scale a bit instead of up-scale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, i have to have a look into the codebase, to be honest, i do not know every thumbnail service detail. please create a issue if we should change something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I’ll play with it and I’ll open new issues if needed.
* `fill` | ||
* `thumbnail` | ||
|
||
To apply one of those, a query parameter has to be added to the request, e.g. `?processor=fit` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the default behavior in case this parameter isn't provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall correctly, this is optional, means behaviour equals before if not added.
Maybe to write: Image generation can optionally be configured...
But @fschade can clarify best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if no processor is provided it uses the default behaviour as before (Resize fort gif, Thumbnail for everything else)
oC10 parameters |
@michaelstingl scalingup has no effect if i remember correctly, |
Okay, I’ll play with it and I’ll open new issues if needed. |
#7409) * feature(thumbnails): add the ability to define custom image processors * fix(ci): add exported member comment * docs(thumbnails): mention processors in readme * fix: codacy and code review feedback * fix: thumbnail readme markdown Co-authored-by: Martin <github@diemattels.at> --------- Co-authored-by: Martin <github@diemattels.at>
References: #7409 (feature(thumbnails): add the ability to define custom image processors) The `Thumbnail Processor` section needed an update to clarify the usecase and behaviour. In addition, the list of sizes above now shows as in a single line each and not in one line.
Description
Thumbnails can now be changed during creation, previously the images were always scaled to fit the given frame,
but it could happen that the images were cut off because they could not be placed better due to the aspect ratio.
This pr introduces the possibility of specifying how the behavior should be, following processors are available
the processor can be applied by adding the processor query param to the request, e.g.
processor=fit
,processor=fill
, ...to find out more how the individual processors work please read https://github.com/disintegration/imaging
if no processor is provided it behaves the same as before (resize for gif's and thumbnail for all other)
needs web changes too, next step....
Related Issue
Motivation and Context
web preview app is not just in use to preview images, but also to actually consume the content, therefor it is needed that images are un-cropped for that, in the file-list for example it is fine to have cropping in place.
How Has This Been Tested?
Screenshots (if appropriate):
without processor:
with fit processor:
Types of changes
Checklist:
could need some docs magic cc.: @mmattel