镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Get operation progress information with handler function #2189

Open

Description

@blocosted

First of all, thanks for the great job done with sharp !!! It is a very powerful tool for images manipulation...

I would like to get some information about progression (percentage or weight) of current image operation (eg: crop, resize, tiles...)

I didn't found anything about this need in all existing issues...

I imagine a handler function injection like :

var transformer = sharp()
  .resize(300)
  .on('progress', function(progress) {
    console.log('Processing: ' + progress.percent + '% done');
  });

I know libvips consider an environment variable named VIPS_PROGRESS, so I guess there is something to do ?

Activity

  1. lovell commented on Apr 30, 2020

    @lovell
    Owner

    By setting the VIPS_PROGRESS environment variable, which outputs percentage progress to stdout, you'll be able to assess how accurate this might be for a given operation.

    Happy to accept a PR if you're able. This will require the use of AsyncProgressWorker and a minimum of N-API version 5, so would have to wait until we drop support for Node.js 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions