-
Notifications
You must be signed in to change notification settings - Fork 186
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
Changes from all commits
edbcb8a
ce0361f
d491d3c
a514837
689c1da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Enhancement: Thumbnail generation with image processors | ||
|
||
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 | ||
|
||
* resize | ||
* fit | ||
* fill | ||
* thumbnail | ||
|
||
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) | ||
|
||
https://github.com/owncloud/ocis/pull/7409 | ||
https://github.com/owncloud/enterprise/issues/6057 | ||
https://github.com/owncloud/ocis/issues/5179 | ||
https://github.com/owncloud/web/issues/7728 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ The relevant environment variables defining file locations are: | |
- (2) `STORAGE_USERS_OCIS_ROOT` | ||
- (3) `THUMBNAILS_FILESYSTEMSTORAGE_ROOT` | ||
|
||
(1) ... Having a default set by the Infinite Scale code, but if defined, used as base path for other services. | ||
(2) ... Source files, defaults to (1) plus path component, but can be freely defined if required. | ||
(3) ... Target files, defaults to (1) plus path component, but can be freely defined if required. | ||
(1) ... Having a default set by the Infinite Scale code, but if defined, used as base path for other services. | ||
(2) ... Source files, defaults to (1) plus path component, but can be freely defined if required. | ||
(3) ... Target files, defaults to (1) plus path component, but can be freely defined if required. | ||
|
||
For details and defaults for these environment variables see the ocis admin documentation. | ||
|
||
|
@@ -45,9 +45,20 @@ Various resolutions can be defined via `THUMBNAILS_RESOLUTIONS`. A requestor can | |
|
||
Example: | ||
|
||
Requested: 18x12 | ||
Available: 30x20, 15x10, 9x6 | ||
Returned: 15x10 | ||
Requested: 18x12 | ||
Available: 30x20, 15x10, 9x6 | ||
Returned: 15x10 | ||
|
||
## Thumbnail Processors | ||
|
||
Image generation can be configured by defining different processors, following processors are available: | ||
|
||
* `resize` | ||
* `fit` | ||
* `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 commentThe 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 commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
||
|
||
## Deleting Thumbnails | ||
|
||
|
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.