0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
ghost/core/server
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
..
adapters Refactored direct usages of api controllers 2018-09-21 15:18:22 +02:00
api Refactored direct usages of api controllers 2018-09-21 15:18:22 +02:00
apps Refactored how we require shared middlewares from web/ (#9893) 2018-09-21 16:17:11 +05:30
config 🔧 Add the 'compress' and 'preloadHeaders' options to defaults.json config (#9863) 2018-09-17 21:36:52 +02:00
data Removed change frequency and priority fields from sitemap generator (#9771) 2018-09-24 19:16:31 +02:00
helpers Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
lib Added new endpoint to upload square profile images with dimension validation (#9862) 2018-09-24 21:42:58 +02:00
models Removed duplicate 'id' for User permittedOptions 2018-09-21 12:15:29 +02:00
public Removed change frequency and priority fields from sitemap generator (#9771) 2018-09-24 19:16:31 +02:00
services Normalised how we require models 2018-09-21 15:16:19 +02:00
translations Added new endpoint to upload square profile images with dimension validation (#9862) 2018-09-24 21:42:58 +02:00
views
web Added new endpoint to upload square profile images with dimension validation (#9862) 2018-09-24 21:42:58 +02:00
analytics-events.js
filters.js Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
ghost-server.js Switched to eslint-plugin-ghost (#9835) 2018-09-17 20:49:30 +02:00
index.js Added timeout before exiting the process 2018-08-16 12:13:24 +02:00
overrides.js Disabled bluebird debug logs 2018-08-13 14:01:31 +02:00
update-check.js Updated docs links 2018-08-16 12:13:24 +02:00