Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lovell/sharp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.26.2
Choose a base ref
...
head repository: lovell/sharp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.33.3
Choose a head ref

Commits on Oct 23, 2020

  1. CI: add Node.js 15 (#2415)

    nstepien authored Oct 23, 2020
    Copy the full SHA
    e6a035e View commit details

Commits on Nov 16, 2020

  1. Docs: use of N-API removes Electron-specific binaries

    Clarify Lambda deployment for Windows/macOS users
    lovell committed Nov 16, 2020
    Copy the full SHA
    ab653ca View commit details
  2. Copy the full SHA
    2872602 View commit details
  3. Copy the full SHA
    0f473fe View commit details
  4. Docs: changelog for #2336

    lovell committed Nov 16, 2020
    Copy the full SHA
    4671810 View commit details
  5. Bump dev dependencies

    lovell committed Nov 16, 2020
    Copy the full SHA
    2678d7a View commit details
  6. Copy the full SHA
    53dd313 View commit details
  7. Copy the full SHA
    fabe720 View commit details
  8. Copy the full SHA
    65acd96 View commit details
  9. Docs: changelog entry for #2412

    lovell committed Nov 16, 2020
    Copy the full SHA
    93455f8 View commit details
  10. Release v0.26.3

    lovell committed Nov 16, 2020
    Copy the full SHA
    c10888e View commit details

Commits on Dec 9, 2020

  1. Copy the full SHA
    a0d89ed View commit details

Commits on Dec 18, 2020

  1. Upgrade to libvips 8.10.5, AVIF support in prebuilt binaries

    Remove experimental status from HEIF, changing defaults
    to prefer royalty-free AV1 over patent-encumbered HEVC
    lovell committed Dec 18, 2020
    Copy the full SHA
    103ec0d View commit details
  2. Copy the full SHA
    e59e146 View commit details

Commits on Dec 20, 2020

  1. Copy the full SHA
    ee54ce9 View commit details
  2. Copy the full SHA
    ef964b5 View commit details
  3. Copy the full SHA
    7c08a09 View commit details
  4. Copy the full SHA
    182beaa View commit details
  5. Allow for negative top/left offsets in composite overlays

    A top or left offset value of -1 will no longer mean that the
    value is not set, but will now be an actual offset of -1.
    
    INT_MIN for left & top will mean that the values are not set.
    
    Co-authored-by: Christian Flintrup <chr@gigahost.dk>
    2 people authored and lovell committed Dec 20, 2020
    Copy the full SHA
    0267614 View commit details

Commits on Dec 21, 2020

  1. Copy the full SHA
    2bbd9b2 View commit details
  2. Copy the full SHA
    0e62bde View commit details
  3. Copy the full SHA
    774d782 View commit details
  4. Copy the full SHA
    f4e259d View commit details

Commits on Dec 22, 2020

  1. Copy the full SHA
    4debc46 View commit details
  2. Release v0.27.0

    lovell committed Dec 22, 2020
    Copy the full SHA
    b2a0b8c View commit details

Commits on Jan 1, 2021

  1. Copy the full SHA
    39ddb6a View commit details
  2. Copy the full SHA
    bf1b326 View commit details

Commits on Jan 6, 2021

  1. Copy the full SHA
    4821a11 View commit details
  2. Docs: changelog entry for #2511

    lovell committed Jan 6, 2021
    Copy the full SHA
    a7003e9 View commit details
  3. Copy the full SHA
    d6376c3 View commit details
  4. Copy the full SHA
    138e60a View commit details

Commits on Jan 13, 2021

  1. Ensure tests pass with latest libvips master branch

    Expose forthcoming HEIF features where available
    lovell committed Jan 13, 2021
    Copy the full SHA
    8d49b7d View commit details
  2. Bump devDependencies

    lovell committed Jan 13, 2021
    Copy the full SHA
    f7e2b36 View commit details
  3. Copy the full SHA
    bba00c2 View commit details
  4. Copy the full SHA
    79170af View commit details
  5. Copy the full SHA
    290df1b View commit details
  6. Copy the full SHA
    762d591 View commit details

Commits on Jan 15, 2021

  1. Copy the full SHA
    5031c83 View commit details

Commits on Jan 16, 2021

  1. Copy the full SHA
    419cbe5 View commit details
  2. Copy the full SHA
    c9f85fe View commit details
  3. Copy the full SHA
    1dd93c1 View commit details

Commits on Jan 18, 2021

  1. Copy the full SHA
    4c57ac2 View commit details

Commits on Jan 24, 2021

  1. Copy the full SHA
    f09be93 View commit details
  2. Copy the full SHA
    98349bd View commit details

Commits on Jan 26, 2021

  1. Copy the full SHA
    0bb8cb9 View commit details
  2. Copy the full SHA
    ceff628 View commit details
  3. Avoid calling g_type_from_name #2535

    kleisauke authored and lovell committed Jan 26, 2021
    Copy the full SHA
    573ed5f View commit details
  4. Copy the full SHA
    24d9e53 View commit details
  5. Copy the full SHA
    67213ae View commit details
  6. Copy the full SHA
    171aade View commit details
Showing 313 changed files with 18,578 additions and 10,621 deletions.
105 changes: 105 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
version: 2.1

workflows:
build:
jobs:
- linux-arm64-glibc-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-glibc-node-20:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-20:
filters:
tags:
only: /^v.*/

jobs:
linux-arm64-glibc-node-18:
resource_class: arm.medium
machine:
image: ubuntu-2204:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp arm64v8/debian:bullseye
sudo docker exec sharp sh -c "apt-get update && apt-get install -y build-essential git python3 curl fonts-noto-core"
sudo docker exec sharp sh -c "mkdir -p /etc/apt/keyrings"
sudo docker exec sharp sh -c "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg"
sudo docker exec sharp sh -c "echo 'deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main' | tee /etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: |
sudo docker exec sharp sh -c "npm run package-from-local-build"
sudo docker exec sharp sh -c "npm pkg set \"optionalDependencies.@img/sharp-linux-arm64=file:./npm/linux-arm64\""
sudo docker exec sharp sh -c "npm run clean"
sudo docker exec sharp sh -c "npm install --ignore-scripts"
sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"cd src && ln -s ../package.json && npx prebuild --upload=$prebuild_upload\" || true"
linux-arm64-glibc-node-20:
resource_class: arm.medium
machine:
image: ubuntu-2204:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --workdir /mnt/sharp arm64v8/debian:bullseye
sudo docker exec sharp sh -c "apt-get update && apt-get install -y build-essential git python3 curl fonts-noto-core"
sudo docker exec sharp sh -c "mkdir -p /etc/apt/keyrings"
sudo docker exec sharp sh -c "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg"
sudo docker exec sharp sh -c "echo 'deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main' | tee /etc/apt/sources.list.d/nodesource.list"
sudo docker exec sharp sh -c "apt-get update && apt-get install -y nodejs"
sudo docker exec sharp sh -c "mkdir -p /mnt/sharp"
sudo docker cp . sharp:/mnt/sharp/.
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: |
sudo docker exec sharp sh -c "npm run package-from-local-build"
sudo docker exec sharp sh -c "npm pkg set \"optionalDependencies.@img/sharp-linux-arm64=file:./npm/linux-arm64\""
sudo docker exec sharp sh -c "npm run clean"
sudo docker exec sharp sh -c "npm install --ignore-scripts"
sudo docker exec sharp sh -c "npm test"
linux-arm64-musl-node-18:
resource_class: arm.medium
machine:
image: ubuntu-2204:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:18-alpine3.17
sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: |
sudo docker exec sharp sh -c "npm run package-from-local-build"
sudo docker exec sharp sh -c "npm pkg set \"optionalDependencies.@img/sharp-linuxmusl-arm64=file:./npm/linuxmusl-arm64\""
sudo docker exec sharp sh -c "npm run clean"
sudo docker exec sharp sh -c "npm install --ignore-scripts"
sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"cd src && ln -s ../package.json && npx prebuild --upload=$prebuild_upload\" || true"
linux-arm64-musl-node-20:
resource_class: arm.medium
machine:
image: ubuntu-2204:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --workdir /mnt/sharp node:20-alpine3.18
sudo docker exec sharp sh -c "apk add build-base git python3 font-noto --update-cache"
sudo docker exec sharp sh -c "mkdir -p /mnt/sharp"
sudo docker cp . sharp:/mnt/sharp/.
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: |
sudo docker exec sharp sh -c "npm run package-from-local-build"
sudo docker exec sharp sh -c "npm pkg set \"optionalDependencies.@img/sharp-linuxmusl-arm64=file:./npm/linuxmusl-arm64\""
sudo docker exec sharp sh -c "npm run clean"
sudo docker exec sharp sh -c "npm install --ignore-scripts"
sudo docker exec sharp sh -c "npm test"
12 changes: 7 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
freebsd_instance:
image_family: freebsd-13-0-snap
image_family: freebsd-14-0-snap

task:
name: FreeBSD 13.0
name: FreeBSD
env:
IGNORE_OSVERSION: yes
skip_notifications: true
prerequisites_script:
- pkg update -f
- pkg upgrade -y
- pkg install -y pkgconf vips node npm
- pkg install -y devel/git devel/pkgconf graphics/vips www/node20 www/npm
- pkg-config --modversion vips-cpp
install_script:
- npm install --unsafe-perm
- npm install --build-from-source
test_script:
- npm test
- npx mocha --no-config --spec=test/unit/io.js --timeout=30000
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

17 changes: 9 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -16,29 +16,30 @@ If a [similar request](https://github.com/lovell/sharp/labels/enhancement) exist
it's probably fastest to add a comment to it about your requirement.

Implementation is usually straightforward if libvips
[already supports](https://libvips.github.io/libvips/API/current/func-list.html)
[already supports](https://www.libvips.org/API/current/func-list.html)
the feature you need.

## Submit a Pull Request to fix a bug

Thank you! To prevent the problem occurring again, please add unit tests that would have failed.

Please select the `master` branch as the destination for your Pull Request so your fix can be included in the next minor release.
Please select the `main` branch as the destination for your Pull Request so your fix can be included in the next minor release.

Please squash your changes into a single commit using a command like `git rebase -i upstream/master`.
Please squash your changes into a single commit using a command like `git rebase -i upstream/main`.

To test C++ changes, you can compile the module using `npm install` and then run the tests using `npm test`.
To test C++ changes, you can compile the module using `npm install --build-from-source` and then run the tests using `npm test`.

## Submit a Pull Request with a new feature

Please add JavaScript [unit tests](https://github.com/lovell/sharp/tree/master/test/unit) to cover your new feature.
Please add JavaScript [unit tests](https://github.com/lovell/sharp/tree/main/test/unit) to cover your new feature.
A test coverage report for the JavaScript code is generated in the `coverage/lcov-report` directory.
Please also update the [TypeScript definitions](https://github.com/lovell/sharp/tree/main/lib/index.d.ts), along with the [type definition tests](https://github.com/lovell/sharp/tree/main/test/types/sharp.test-d.ts).

Where possible, the functional tests use gradient-based perceptual hashes
based on [dHash](http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html)
to compare expected vs actual images.

You deserve to add your details to the [list of contributors](https://github.com/lovell/sharp/blob/master/package.json#L5).
You deserve to add your details to the [list of contributors](https://github.com/lovell/sharp/blob/main/package.json#L5).

Any change that modifies the existing public API should be added to the relevant work-in-progress branch for inclusion in the next major release.

@@ -62,7 +63,7 @@ By way of example, the `background()` method present in v0.20.0 was deprecated i

## Documentation

The public API is documented with [JSDoc](http://usejsdoc.org/) annotated comments.
The public API is documented with [JSDoc](https://jsdoc.app/) annotated comments.

These can be converted to Markdown by running:
```sh
@@ -93,5 +94,5 @@ Please feel free to ask any questions via a
[new issue](https://github.com/lovell/sharp/issues/new).

If you're unable to post details publicly, please
[e-mail](https://github.com/lovell/sharp/blob/master/package.json#L5)
[e-mail](https://github.com/lovell/sharp/blob/main/package.json#L5)
for private, paid consulting.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://sharp.pixelplumbing.com/
about: Installation instructions, complete API documentation with examples, changelog
22 changes: 17 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -5,12 +5,24 @@ labels: enhancement

---

What are you trying to achieve?
## Feature request

Have you searched for similar feature requests?
### What are you trying to achieve?

What would you expect the API to look like?
<!-- Please provide context here. -->

What alternatives have you considered?
### When you searched for similar feature requests, what did you find that might be related?

Is there a sample image that helps explain?
<!-- Please demonstrate your research here. -->

### What would you expect the API to look like?

<!-- Please provide your suggestions here. -->

### What alternatives have you considered?

<!-- Please provide your ideas here. -->

### Please provide sample image(s) that help explain this feature

<!-- Please provide links to one or more images here. -->
63 changes: 56 additions & 7 deletions .github/ISSUE_TEMPLATE/installation.md
Original file line number Diff line number Diff line change
@@ -5,16 +5,65 @@ labels: installation

---

Did you see the [documentation relating to installation](https://sharp.pixelplumbing.com/install)?
<!-- Please try to answer as many of these questions as possible. -->

Have you ensured the architecture and platform of Node.js used for `npm install` is the same as the architecture and platform of Node.js used at runtime?
## Possible install-time or require-time problem

Are you using the latest version? Is the version currently in use as reported by `npm ls sharp` the same as the latest version as reported by `npm view sharp dist-tags.latest`?
<!-- Please place an [x] in the box to confirm. -->

If you are installing as a `root` or `sudo` user, have you tried with the `npm install --unsafe-perm` flag?
- [ ] I have read and understood all of the [documentation relating to installation](https://sharp.pixelplumbing.com/install).
- [ ] I have searched for known bugs relating to this problem in my choice of package manager.

If you are using the `ignore-scripts` feature of `npm`, have you tried with the `npm install --ignore-scripts=false` flag?
You must confirm both of these before continuing.

What is the complete output of running `npm install --verbose sharp`? Have you checked this output for useful error messages?
### Are you using the latest version of sharp?

What is the output of running `npx envinfo --binaries --system`?
<!-- Please place an [x] in the box to confirm. -->

- [ ] I am using the latest version of `sharp` as reported by `npm view sharp dist-tags.latest`.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of `sharp` that is not the latest,
please open an issue against that package instead.

### Are you using a supported runtime?

<!-- Please place an [x] in the relevant box to confirm. -->

- [ ] I am using Node.js with a version that satisfies `^18.17.0 || ^20.3.0 || >=21.0.0`
- [ ] I am using Deno
- [ ] I am using Bun

If you cannot confirm any of these,
please upgrade to the latest version
and try again before opening an issue.

### Are you using a supported package manager and installing optional dependencies?

<!-- Please place an [x] in the relevant box to confirm. -->

- [ ] I am using npm >= 9.6.5 with `--include=optional`
- [ ] I am using yarn >= 3.2.0
- [ ] I am using pnpm >= 7.1.0 with `--no-optional=false`
- [ ] I am using Deno
- [ ] I am using Bun

If you cannot confirm any of these, please upgrade to the latest version of your chosen package manager
and ensure you are allowing the installation of optional or multi-platform dependencies before opening an issue.

### What is the complete error message, including the full stack trace?

<!-- Please provide the error message and stack trace here. -->

### What is the complete output of running `npm install --verbose --foreground-scripts sharp` in an empty directory?

<details>

<!-- Please provide output of `npm install --verbose --foreground-scripts sharp` in an empty directory here. -->

</details>

### What is the output of running `npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp`?

<!-- Please provide output of `npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp` here. -->
41 changes: 35 additions & 6 deletions .github/ISSUE_TEMPLATE/possible-bug.md
Original file line number Diff line number Diff line change
@@ -7,14 +7,43 @@ labels: triage

<!-- If this issue relates to installation, please use https://github.com/lovell/sharp/issues/new?labels=installation&template=installation.md instead. -->

Are you using the latest version? Is the version currently in use as reported by `npm ls sharp` the same as the latest version as reported by `npm view sharp dist-tags.latest`?
## Possible bug

What are the steps to reproduce?
### Is this a possible bug in a feature of sharp, unrelated to installation?

What is the expected behaviour?
<!-- Please place an [x] in the box to confirm. -->

Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?
- [ ] Running `npm install sharp` completes without error.
- [ ] Running `node -e "require('sharp')"` completes without error.

Are you able to provide a sample image that helps explain the problem?
If you cannot confirm both of these, please open an [installation issue](https://github.com/lovell/sharp/issues/new?labels=installation&template=installation.md) instead.

What is the output of running `npx envinfo --binaries --system`?
### Are you using the latest version of sharp?

<!-- Please place an [x] in the box to confirm. -->

- [ ] I am using the latest version of `sharp` as reported by `npm view sharp dist-tags.latest`.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of `sharp` that is not the latest, please open an issue against that package instead.

### What is the output of running `npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp`?

<!-- Please provide output of the above command here. -->

### What are the steps to reproduce?

<!-- Please enter steps to reproduce here. -->

### What is the expected behaviour?

<!-- Please enter the expected behaviour here. -->

### Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem

<!-- Please provide either formatted code or a link to a repo/gist that allows someone else to reproduce here. -->

### Please provide sample image(s) that help explain this problem

<!-- Please provide links to one or more images here. -->
18 changes: 14 additions & 4 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,20 @@ labels: question

<!-- If this issue relates to installation, please use https://github.com/lovell/sharp/issues/new?labels=installation&template=installation.md instead. -->

What are you trying to achieve?
## Question about an existing feature

Have you searched for similar questions?
### What are you trying to achieve?

Are you able to provide a minimal, standalone code sample that demonstrates this question?
<!-- Please provide context here. -->

Are you able to provide a sample image that helps explain the question?
### When you searched for similar issues, what did you find that might be related?

<!-- Please demonstrate your research here. -->

### Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question

<!-- Please provide either formatted code or a link to a repo/gist that helps someone else understand here. -->

### Please provide sample image(s) that help explain this question

<!-- Please provide links to one or more images here. -->
18 changes: 18 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Security Policy

## Supported Versions

The latest version of `sharp` as published to npm
and reported by `npm view sharp dist-tags.latest`
is supported with security updates.

## Reporting a Vulnerability

Please use
[e-mail](https://github.com/lovell/sharp/blob/main/package.json#L5)
to report a vulnerability.

You can expect a response within 48 hours
if you are a human reporting a genuine issue.

Thank you in advance.
Loading