Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metaReader #1495

Closed
sm2017 opened this issue Dec 6, 2018 · 4 comments
Closed

metaReader #1495

sm2017 opened this issue Dec 6, 2018 · 4 comments
Labels

Comments

@sm2017
Copy link

sm2017 commented Dec 6, 2018

const metaReader = sharp()
  .metadata()
  .then(info => {
    console.log(info)
  })
  .catch(err => {
    console.log(err)
  })

is metaReader fast enough to using it in a high throughput server? is it block thread?
I want to pipe(metaReader) a stream , stream is a file uploaded by end user

@lovell
Copy link
Owner

lovell commented Dec 6, 2018

"Everything remains non-blocking thanks to libuv, no child processes are spawned and Promises/async/await are supported."

http://sharp.pixelplumbing.com/en/stable/#fast

@lovell lovell added the question label Dec 6, 2018
@sm2017
Copy link
Author

sm2017 commented Dec 6, 2018

@lovell I want to

  • Get a file from end user
  • Check dimension
  • must be square
    • larger than 100x100
    • less than 1000x1000
  • Generate thumbnail

I want to check dimension in main thread , but generate thumbnail in a worker thread (using rabbitmq)

I see http://sharp.pixelplumbing.com/en/stable/performance/
You have 25.30 Ops/sec , is it 1000/25=40ms blocks thread? If yes I must use worker thread , If no , can I use main thread to generate thumbnail?
What about dimension? how much it block thread?

@lovell
Copy link
Owner

lovell commented Dec 6, 2018

Please see #1297

@lovell
Copy link
Owner

lovell commented Dec 28, 2018

Hope this helped, please feel free to re-open with more details if not.

@lovell lovell closed this as completed Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants