Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coderofsalvation/parse-server-image-resize-byurl
Flexible way to resize images on demand (using url-arguments)
https://github.com/coderofsalvation/parse-server-image-resize-byurl
Last synced: 12 days ago
JSON representation
Flexible way to resize images on demand (using url-arguments)
- Host: GitHub
- URL: https://github.com/coderofsalvation/parse-server-image-resize-byurl
- Owner: coderofsalvation
- Created: 2019-10-30T15:38:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-07T03:56:23.000Z (over 1 year ago)
- Last Synced: 2024-10-26T13:41:34.590Z (18 days ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
Flexible Parse server middleware to resize images on demand:
* http://my.parse.server/api/files/myproject/72243e65cd8af516dbc8a67b344.PNG?w=200
* http://my.parse.server/api/files/myproject/72243e65cd8af516dbc8a67b344.PNG?w=700> It resizes on demand, or serves a cached file after the first requests
Fast performance: it clamps imagesizes:
* ?w=200 => resizes to width of 200px
* ?w=260 => resizes to width of 300px
* ?w=320 => resizes to width of 400px## Installation
$ npm install parse-server-image-resize-byurl
now add it as express middleware:
```
var cfg {...
filesAdapter: {
module: 'parse-server-fs-store-adapter',
options: { filesSubDirectory: 'data/files' }
}
}var parse = new ParseServer(cfg)
var app = express()
app.use( require('parse-server-image-resize-byurl')(cfg.filesAdapter.options.filesSubDirectory) )
```Now you can just use Parse imagefiles as usual, and add the `?w=xxxx` resize-option to urls.