pmb0 / express-sharp

🏞 Real-time image processing for your express application.
MIT License
149 stars 31 forks source link

Add extract option #6

Closed michaseel closed 3 years ago

michaseel commented 7 years ago

For certain use-cases the sharp "extract" option is pretty handy. http://sharp.dimens.io/en/stable/api-operation/#extract

michaseel commented 7 years ago

The main problem will be to find a simple API to use the complex extract feature. I like the how the imgix api adds more features to the crop option like: entropy, face-recoginition, focal-point, zoom etc. https://docs.imgix.com/apis/url/size/crop

michaseel commented 7 years ago

A more general discussion would be to change the api to completely use url-query's instead of mixed params and query´s

Without params its easier to convert your options to a query-string:

import queryString from 'query-string';
cosnt src = queryString.stringify({
    url,
    quality,
    width,
    height,
    crop,
    ...
  });