Ghost/core/server/web/shared/middlewares
Rishabh Garg 39485d17c0 Added new endpoint to upload square profile images with dimension validation (#9862)
refs #8576

- adds new API endpoint `/uploads/profile-image` for uploading profile images
- new validation which fails with error message if uploaded image is not square
- Renamed getImageSizeFromFilePath to getImageSizeFromStoragePath, because it's more explicit
- Add new getImageSizeFromPath method, which is used in the new dimensions middleware
- Ensure we use the sharp middleware to auto-resize the uploaded profile pictures
- Ensure the new route get's added to v2

While this makes sure all future profile images uploaded are square, this doesn’t affect any existing non-square profile image. Needs more thought on how to handle existing non-square profile images for the purpose of making theming easier in future.
2018-09-24 21:42:58 +02:00
..
api Refactored how we require shared middlewares from web/ (#9893) 2018-09-21 16:17:11 +05:30
image Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
validation Added new endpoint to upload square profile images with dimension validation (#9862) 2018-09-24 21:42:58 +02:00
admin-redirects.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
brute.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
cache-control.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
custom-redirects.js 🎨Added case insensitive support for redirects (#9755) 2018-09-24 18:57:05 +02:00
error-handler.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
frontend-client.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
ghost-locals.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
index.js Refactored how we require shared middlewares from web/ (#9893) 2018-09-21 16:17:11 +05:30
labs.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
log-request.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
maintenance.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
pretty-urls.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
serve-favicon.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
serve-public-file.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
static-theme.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00
uncapitalise.js Extended uncapitalise unit tests (#9891) 2018-09-20 22:27:38 +02:00
url-redirects.js Refactored web/middleware and web/utils to web/shared (#9892) 2018-09-20 20:04:34 +02:00