lovell / lovell/sharp

Is it possible to support `icc` of type Buffer in the withMetadata method?

Open
#3,704 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocked-upstream-dependency enhancement
Dominant language
JavaScript
Stars
32.7k
Forks
1.4k
Avg merge
1d 14h
Merged PRs (30d)
5

Description

```
const {icc} = await $s.metadata();
const rawBuf = await $s.raw().withMetadata({icc}).toBuffer();
```

Error: Expected string filesystem path to ICC profile for icc but received .... of type object

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the withMetadata({icc}) call in the reproduction and trace how the metadata value reaches the ICC validation shown in the error. Done means a Buffer returned by metadata() can be passed back through withMetadata and the raw image can be written with toBuffer without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.