jwagner/smartcrop-sharp

Support for using a readable stream

Aperta

#6 aperta il 15 ott 2019

 (2 commenti) (2 reazioni) (0 assegnatari)JavaScript (14 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (119 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

It might just be something to add in the docs but is there any possible way to use this as part of a transformation stream? If I wanted to implement sharp in the following way for example:

const transform = sharp().rotate();
const smartcrop = smartcrop( result => {
  transform.extract( result.topCrop )
} )
readableStream.pipe( smartcrop ).pipe( transform ).pipe( writableStream );

No worries if it's difficult / impossible to support. I'm trying to make my service a less memory intensive for large files.

Guida contributor