Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Add option to prevent upsizing contained thumbnails #1168

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

wcerfgba
Copy link

I am using the thumbnailer to load all images to provide sanitization of user uploaded content -- I would rather pass the image through Intervention than serve the original upload to visitors, in case it was malicious.

Currently the thumbnailer forces the requested size, and will scale up images, but for this use case I would rather not scale up images. The resize method we use has a upsize constraint which prevents scaling the image [1].

I've exposed this as an option so it's backwards compatible.

I had a look for tests but couldn't find any. Do we want tests on the thumbnailer endpoints, or unit tests?

Thanks! 馃榾

[1] http://image.intervention.io/api/resize

@binal-7span binal-7span added the enhancement New feature or request label Aug 1, 2019
Copy link
Contributor

@binal-7span binal-7span left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json and Application.php are unwanted files. Kindly make sure that you have rebased develop branch and remove these files from this PR.

@wcerfgba
Copy link
Author

wcerfgba commented Aug 1, 2019

Sorry @bjgajjar I originally branched from master by mistake, this is now fixed. 馃憤

@binal-7span binal-7span merged commit 2705839 into directus:develop Aug 1, 2019
@binal-7span binal-7span added this to Done in v2.4.0 Aug 1, 2019
rijkvanzanten pushed a commit that referenced this pull request Aug 7, 2019
* Parent + Nested validation changes (#1138)

* #1121 (#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Issue Fix #1148 (#1152)

* Fix 1149 (#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (#1153)

* added array type to schema

* Update logo without page refresh (#1162)

* skipped schema validation for config from api.php

* Resolve the error of validation of primary key (#1166)

* Don't use special characters in creation of project auth tokens (#1169)

* Comment PHP variables in htaccess. (#1145)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Remove warning of undefined index size (#1140)

* Add thumbnails for PDF. (#1141)

* Remove PHP vaeiable from htaccess.

* Update .htaccess

* Update public/.htaccess

Co-Authored-By: Rijk van Zanten <rijkvanzanten@me.com>

* Issue Fix #1161 (#1165)

* Issue fix #1161

* Check for O2M

* Add option to prevent upsizing contained thumbnails. (#1168)

* Issue Fix #1170 (#1175)

* Release 2.3.1 (#1158)

* Parent + Nested validation changes (#1138)

* #1121 (#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Issue Fix #1148 (#1152)

* Fix 1149 (#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (#1153)

* Bump version to v2.3.1

* Merge conflict resolve

* Issue Fix #1170

* Rebase files

* added new config key "ext" for all external config with type ARRAY.
added tests.

* made "ext" key optional

* Issue fix/1176 (#1177)
rijkvanzanten added a commit that referenced this pull request Aug 8, 2019
* Parent + Nested validation changes (#1138)

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Update logo without page refresh (#1162)

* Resolve the error of validation of primary key (#1166)

* Don't use special characters in creation of project auth tokens (#1169)

* Comment PHP variables in htaccess. (#1145)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Remove warning of undefined index size (#1140)

* Add thumbnails for PDF. (#1141)

* Remove PHP vaeiable from htaccess.

* Update .htaccess

* Update public/.htaccess

Co-Authored-By: Rijk van Zanten <rijkvanzanten@me.com>

* Issue Fix #1161 (#1165)

* Issue fix #1161

* Check for O2M

* Add option to prevent upsizing contained thumbnails. (#1168)

* Issue Fix #1170 (#1175)

* Release 2.3.1 (#1158)

* Parent + Nested validation changes (#1138)

* #1121 (#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Issue Fix #1148 (#1152)

* Fix 1149 (#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (#1153)

* Bump version to v2.3.1

* Merge conflict resolve

* Issue Fix #1170

* Rebase files

* Issue fix/1176 (#1177)

* added array type to schema (#1163)

* Parent + Nested validation changes (#1138)

* #1121 (#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Issue Fix #1148 (#1152)

* Fix 1149 (#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (#1153)

* added array type to schema

* Update logo without page refresh (#1162)

* skipped schema validation for config from api.php

* Resolve the error of validation of primary key (#1166)

* Don't use special characters in creation of project auth tokens (#1169)

* Comment PHP variables in htaccess. (#1145)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Remove warning of undefined index size (#1140)

* Add thumbnails for PDF. (#1141)

* Remove PHP vaeiable from htaccess.

* Update .htaccess

* Update public/.htaccess

Co-Authored-By: Rijk van Zanten <rijkvanzanten@me.com>

* Issue Fix #1161 (#1165)

* Issue fix #1161

* Check for O2M

* Add option to prevent upsizing contained thumbnails. (#1168)

* Issue Fix #1170 (#1175)

* Release 2.3.1 (#1158)

* Parent + Nested validation changes (#1138)

* #1121 (#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix #1109 (#1146)

* Added file support for 7.0 (Explained) (#1124)

* Bump version to 2.3.0 (#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix #1114 (#1128)

* Issue Fix #1114

* Change exception message

* Update .gitignore (#1129)

* Bump version to 2.3.0 (#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix #1125 (#1134)

* Issue Fix #1131 (#1135)

* create thumb for pdf if imagick is available (#1123)

* Bump version to 2.3.0 (#1120)

* create thumb for pdf if imagick is available

* Issue Fix #1109

* Add Special characters in the radom string generator

* Issue Fix #1109

* Remove other option

* Imagick changes

* Issue Fix #1148 (#1152)

* Fix 1149 (#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (#1153)

* Bump version to v2.3.1

* Merge conflict resolve

* Issue Fix #1170

* Rebase files

* added new config key "ext" for all external config with type ARRAY.
added tests.

* made "ext" key optional

* Issue fix/1176 (#1177)

* Issue fix #1179 (#1181)

* Release v2.4.0
itsmerhp pushed a commit to itsmerhp/api that referenced this pull request Aug 31, 2019
* Parent + Nested validation changes (directus#1138)

* directus#1121 (directus#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix directus#1109 (directus#1146)

* Added file support for 7.0 (Explained) (directus#1124)

* Bump version to 2.3.0 (directus#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix directus#1114 (directus#1128)

* Issue Fix directus#1114

* Change exception message

* Update .gitignore (directus#1129)

* Bump version to 2.3.0 (directus#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix directus#1125 (directus#1134)

* Issue Fix directus#1131 (directus#1135)

* create thumb for pdf if imagick is available (directus#1123)

* Bump version to 2.3.0 (directus#1120)

* create thumb for pdf if imagick is available

* Issue Fix directus#1109

* Add Special characters in the radom string generator

* Issue Fix directus#1109

* Remove other option

* Imagick changes

* Issue Fix directus#1148 (directus#1152)

* Fix 1149 (directus#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (directus#1153)

* added array type to schema

* Update logo without page refresh (directus#1162)

* skipped schema validation for config from api.php

* Resolve the error of validation of primary key (directus#1166)

* Don't use special characters in creation of project auth tokens (directus#1169)

* Comment PHP variables in htaccess. (directus#1145)

* Added file support for 7.0 (Explained) (directus#1124)

* Bump version to 2.3.0 (directus#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix directus#1114 (directus#1128)

* Issue Fix directus#1114

* Change exception message

* Update .gitignore (directus#1129)

* Bump version to 2.3.0 (directus#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix directus#1125 (directus#1134)

* Issue Fix directus#1131 (directus#1135)

* create thumb for pdf if imagick is available (directus#1123)

* Bump version to 2.3.0 (directus#1120)

* create thumb for pdf if imagick is available

* Remove warning of undefined index size (directus#1140)

* Add thumbnails for PDF. (directus#1141)

* Remove PHP vaeiable from htaccess.

* Update .htaccess

* Update public/.htaccess

Co-Authored-By: Rijk van Zanten <rijkvanzanten@me.com>

* Issue Fix directus#1161 (directus#1165)

* Issue fix directus#1161

* Check for O2M

* Add option to prevent upsizing contained thumbnails. (directus#1168)

* Issue Fix #1170 (directus#1175)

* Release 2.3.1 (directus#1158)

* Parent + Nested validation changes (directus#1138)

* directus#1121 (directus#1126)

* Public Role : UserId should be set 0 instead of null

* Change : invalid token

* Issue Fix directus#1109 (directus#1146)

* Added file support for 7.0 (Explained) (directus#1124)

* Bump version to 2.3.0 (directus#1120)

* Added file support for 7.0 (Explained)

Having `public` in front of `const` completely breaks the application for `PHP 7.0` usage, which broke everything when I pulled origin.

Though I understand `PHP 7.0` isn't officially supported, and that `PHP 7.1+` is, there is no reason to use public alongside const as the default visibility of class constants are public. We might as well provide support where possible if it doesn't hurt.

Explained here:
https://stackoverflow.com/a/51568547

* Issue Fix directus#1114 (directus#1128)

* Issue Fix directus#1114

* Change exception message

* Update .gitignore (directus#1129)

* Bump version to 2.3.0 (directus#1120)

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Update .gitignore

* Issue Fix directus#1125 (directus#1134)

* Issue Fix directus#1131 (directus#1135)

* create thumb for pdf if imagick is available (directus#1123)

* Bump version to 2.3.0 (directus#1120)

* create thumb for pdf if imagick is available

* Issue Fix directus#1109

* Add Special characters in the radom string generator

* Issue Fix directus#1109

* Remove other option

* Imagick changes

* Issue Fix directus#1148 (directus#1152)

* Fix 1149 (directus#1156)

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Process relation & non relatinal fields sequentially to solve logical operator issue

* Fixed namespace of InvalidLoggerConfigurationException (directus#1153)

* Bump version to v2.3.1

* Merge conflict resolve

* Issue Fix #1170

* Rebase files

* added new config key "ext" for all external config with type ARRAY.
added tests.

* made "ext" key optional

* Issue fix/1176 (directus#1177)
samvasko pushed a commit to samvasko/api that referenced this pull request Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
v2.4.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants