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

Help for improve the performance on composite #2381

Closed
fbonhomm opened this issue Sep 23, 2020 · 1 comment
Closed

Help for improve the performance on composite #2381

fbonhomm opened this issue Sep 23, 2020 · 1 comment
Labels

Comments

@fbonhomm
Copy link

Hi, I'm using sharp for add markers on image and this part take 3-4 seconds.

I found that too slow, Do you have an improvement for reduce this time.

  const image = sharp(input);
  const composites = positions.map((item) => {
    return {
      input: item.number ? getTaskPin(item.number) : getPointer(),
      top: item.x,
      left: item.y,
    };
  });

  return image
    .metadata()
    .then(function (metadata) {
      const orientation = isLandscape(metadata.width, metadata.height);

      return image
        .composite(composites)
        .rotate(orientation ? 90 : 0)
        .sharpen()
        .jpeg()
        .toBuffer();
    });
@lovell
Copy link
Owner

lovell commented Sep 23, 2020

Hi, did you see #2286 ?

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