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: eefaa998725cf345227d94b40615e090495c6d09
Choose a base ref
...
head repository: lovell/sharp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 545e09fad2e10eb9d21c03fe4ad73196e36ffc98
Choose a head ref

Commits on Sep 23, 2023

  1. Copy the full SHA
    ba20b8a View commit details
  2. Copy the full SHA
    6578118 View commit details
  3. Upgrade to Node-API version 9

    lovell committed Sep 23, 2023
    Copy the full SHA
    e618c17 View commit details
  4. Copy the full SHA
    61c5cb4 View commit details

Commits on Sep 24, 2023

  1. CI: Add linux-arm (v6, 32-bit)

    lovell committed Sep 24, 2023
    Copy the full SHA
    efee9f1 View commit details
  2. Copy the full SHA
    0f8bb91 View commit details

Commits on Sep 26, 2023

  1. Distribute prebuilt binaries via the npm registry #3750

    - Remove all custom download logic for prebuilt binaries
    - Add scripts to populate package contents
    - Specify minimum versions of common package managers
    - Remove sharp.vendor runtime API as no-longer relevant
    - Update installation docs and issue templates
    lovell committed Sep 26, 2023
    Copy the full SHA
    aabbe1f View commit details
  2. Copy the full SHA
    70a3067 View commit details
  3. Copy the full SHA
    8f63d13 View commit details
  4. Test: remove saliency directory

    These scripts were originally used to help determine
    some of the logic that is now part of the 'attention'
    crop strategy in libvips itself.
    lovell committed Sep 26, 2023
    Copy the full SHA
    854ed65 View commit details
  5. Copy the full SHA
    a41c62b View commit details

Commits on Sep 27, 2023

  1. Copy the full SHA
    36feb75 View commit details
  2. Copy the full SHA
    3043e01 View commit details
  3. Copy the full SHA
    59327bd View commit details

Commits on Sep 28, 2023

  1. Copy the full SHA
    265d701 View commit details

Commits on Sep 30, 2023

  1. Use std::atomic for counters

    lovell committed Sep 30, 2023
    Copy the full SHA
    70ac690 View commit details

Commits on Oct 3, 2023

  1. Copy the full SHA
    9161c60 View commit details

Commits on Oct 4, 2023

  1. Prerelease 0.33.0-alpha.2

    lovell committed Oct 4, 2023
    Copy the full SHA
    7cf4ae5 View commit details
  2. Copy the full SHA
    f31011d View commit details
  3. Copy the full SHA
    4d3c9ae View commit details
  4. Copy the full SHA
    226a9a1 View commit details
  5. Copy the full SHA
    fcc7e84 View commit details
  6. Copy the full SHA
    7c97aab View commit details
  7. Copy the full SHA
    392f6af View commit details

Commits on Oct 5, 2023

  1. Copy the full SHA
    ca95979 View commit details
  2. Copy the full SHA
    f8cf25c View commit details
  3. Copy the full SHA
    58e3c4c View commit details

Commits on Oct 6, 2023

  1. Copy the full SHA
    08108f5 View commit details
  2. Prerelease 0.33.0-alpha.3

    lovell committed Oct 6, 2023
    Copy the full SHA
    a9aa733 View commit details
  3. Prerelease 0.33.0-alpha.4

    lovell committed Oct 6, 2023
    Copy the full SHA
    68ac122 View commit details

Commits on Oct 7, 2023

  1. Copy the full SHA
    51e56f9 View commit details

Commits on Oct 8, 2023

  1. Building from source now requires node-addon-api in dependencies

    If you want to build sharp from source against a globally-installed
    libvips then you will now need to add both node-addon-api and
    node-gyp to the dependencies section of your package.json file.
    
    The binding.gyp file is "hidden" inside the src directory to
    prevent various build and package manager tooling from assuming
    that everyone is going to build from source every time.
    lovell committed Oct 8, 2023
    Copy the full SHA
    f7da2e5 View commit details
  2. Prerelease 0.33.0-alpha.5

    lovell committed Oct 8, 2023
    Copy the full SHA
    8d033ae View commit details
  3. Copy the full SHA
    f54ceb0 View commit details
  4. Copy the full SHA
    4dc2467 View commit details

Commits on Oct 9, 2023

  1. Remove extraneous rpath

    The sharp.node shared library should now always end up being
    nested either 3 subdirectories deep into the package root or exist
    within same namespace of the node_modules tree.
    lovell committed Oct 9, 2023
    Copy the full SHA
    3f54ef7 View commit details
  2. CI: Add smoke test for npm-published package

    These tests will fail on their first run as a tag will exist but
    the matching packages will not yet have been published.
    
    The workflow can be manually re-run after publishing to npm.
    
    Eventually, when there's some form of automated publishing, this
    logic can become part of the post-publish checks.
    lovell committed Oct 9, 2023
    Copy the full SHA
    29a8325 View commit details
  3. Prerelease 0.33.0-alpha.6

    lovell committed Oct 9, 2023
    Copy the full SHA
    946976b View commit details
  4. Copy the full SHA
    3b22640 View commit details
  5. Copy the full SHA
    09460d7 View commit details

Commits on Oct 10, 2023

  1. Copy the full SHA
    7e25dd7 View commit details
  2. Revert "Remove extraneous rpath"

    This reverts commit 3f54ef7.
    
    The filesystem layout used by pnpm means that a nesting of 2
    directories deep is used in the wild and must remain.
    lovell committed Oct 10, 2023
    Copy the full SHA
    4b028ed View commit details
  3. Copy the full SHA
    9b5eecb View commit details
  4. Copy the full SHA
    7c2f883 View commit details
  5. Prerelease 0.33.0-alpha.7

    lovell committed Oct 10, 2023
    Copy the full SHA
    ab00e34 View commit details
  6. Revert "Package managers cannot handle nested optionalDependencies"

    This partially reverts commit 51e56f9.
    
    Ignoring plug'n'play, it looks like yarn and pnpm do get the
    filesystem layout right for this scenario, which is good news.
    
    It also looks like npm 10 will get it right too.
    lovell committed Oct 10, 2023
    Copy the full SHA
    80e4707 View commit details
  7. Prerelease 0.33.0-alpha.8

    lovell committed Oct 10, 2023
    Copy the full SHA
    6377d5a View commit details

Commits on Oct 11, 2023

  1. Copy the full SHA
    28a9b1e View commit details
  2. Copy the full SHA
    ff2fb18 View commit details
  3. Remove unused gitattributes

    lovell committed Oct 11, 2023
    Copy the full SHA
    68fa84e View commit details
Showing with 3,057 additions and 7,646 deletions.
  1. +44 −18 .circleci/config.yml
  2. +1 −1 .cirrus.yml
  3. +0 −1 .gitattributes
  4. +16 −5 .github/ISSUE_TEMPLATE/installation.md
  5. +0 −40 .github/workflows/ci-darwin-arm64v8.yml
  6. +176 −41 .github/workflows/ci.yml
  7. +150 −0 .github/workflows/npm.yml
  8. +4 −7 .gitignore
  9. +3 −1 .prebuildrc
  10. +6 −2 README.md
  11. +6 −2 docs/README.md
  12. +3 −3 docs/api-colour.md
  13. +5 −1 docs/api-constructor.md
  14. +153 −37 docs/api-output.md
  15. +23 −26 docs/api-resize.md
  16. +2 −14 docs/api-utility.md
  17. +49 −0 docs/changelog.md
  18. +6 −0 docs/humans.txt
  19. +71 −166 docs/install.md
  20. +39 −39 docs/performance.md
  21. +1 −1 docs/search-index.json
  22. +0 −14 install/can-compile.js
  23. +36 −0 install/check.js
  24. +0 −40 install/dll-copy.js
  25. +0 −222 install/libvips.js
  26. +0 −44 lib/agent.js
  27. +4 −6 lib/colour.js
  28. +15 −10 lib/constructor.js
  29. +79 −23 lib/index.d.ts
  30. +34 −8 lib/input.js
  31. +28 −14 lib/is.js
  32. +86 −55 lib/libvips.js
  33. +221 −73 lib/output.js
  34. +0 −30 lib/platform.js
  35. +46 −46 lib/resize.js
  36. +74 −26 lib/sharp.js
  37. +25 −25 lib/utility.js
  38. +44 −0 npm/darwin-arm64/package.json
  39. +44 −0 npm/darwin-x64/package.json
  40. +73 −0 npm/from-github-release.js
  41. +26 −0 npm/from-local-build.js
  42. +47 −0 npm/linux-arm/package.json
  43. +47 −0 npm/linux-arm64/package.json
  44. +47 −0 npm/linux-s390x/package.json
  45. +47 −0 npm/linux-x64/package.json
  46. +47 −0 npm/linuxmusl-arm64/package.json
  47. +47 −0 npm/linuxmusl-x64/package.json
  48. +18 −0 npm/package.json
  49. +42 −0 npm/wasm32/package.json
  50. +42 −0 npm/win32-ia32/package.json
  51. +42 −0 npm/win32-x64/package.json
  52. +56 −41 package.json
  53. +89 −48 { → src}/binding.gyp
  54. +53 −5 src/common.cc
  55. +21 −5 src/common.h
  56. +40 −0 src/emscripten/common.gypi
  57. +19 −0 src/emscripten/pre.js
  58. +0 −151 src/libvips/cplusplus/VConnection.cpp
  59. +0 −49 src/libvips/cplusplus/VError.cpp
  60. +0 −1,548 src/libvips/cplusplus/VImage.cpp
  61. +0 −62 src/libvips/cplusplus/VInterpolate.cpp
  62. +0 −27 src/libvips/cplusplus/VRegion.cpp
  63. +0 −3,760 src/libvips/cplusplus/vips-operators.cpp
  64. +5 −5 src/metadata.cc
  65. +35 −18 src/operations.cc
  66. +3 −3 src/operations.h
  67. +69 −60 src/pipeline.cc
  68. +13 −9 src/pipeline.h
  69. +6 −7 src/sharp.cc
  70. +5 −5 src/stats.cc
  71. +20 −5 src/utilities.cc
  72. +6 −4 test/bench/Dockerfile
  73. +3 −6 test/bench/package.json
  74. +8 −6 test/bench/perf.js
  75. BIN test/fixtures/expected/tint-alpha.png
  76. BIN test/fixtures/expected/tint-blue.jpg
  77. BIN test/fixtures/expected/tint-cmyk.jpg
  78. BIN test/fixtures/expected/tint-green.jpg
  79. BIN test/fixtures/expected/tint-red.jpg
  80. BIN test/fixtures/expected/tint-sepia.jpg
  81. +6 −4 test/leak/leak.sh
  82. +105 −39 test/leak/sharp.supp
  83. +0 −16 test/saliency/README.md
  84. +0 −25 test/saliency/download.sh
  85. +0 −40 test/saliency/humanae/download.js
  86. +0 −9 test/saliency/humanae/package.json
  87. +0 −36 test/saliency/humanae/tone.js
  88. +0 −25 test/saliency/report.html
  89. +0 −82 test/saliency/report.js
  90. +0 −74 test/saliency/userData.js
  91. +17 −4 test/types/sharp.test-d.ts
  92. +0 −52 test/unit/agent.js
  93. +3 −3 test/unit/composite.js
  94. +4 −4 test/unit/extend.js
  95. +11 −0 test/unit/extract.js
  96. +12 −12 test/unit/heif.js
  97. +26 −24 test/unit/io.js
  98. +1 −1 test/unit/jpeg.js
  99. +42 −53 test/unit/libvips.js
  100. +22 −21 test/unit/median.js
  101. +182 −53 test/unit/metadata.js
  102. +0 −91 test/unit/platform.js
  103. +38 −0 test/unit/raw.js
  104. +1 −1 test/unit/resize.js
  105. +15 −1 test/unit/stats.js
  106. +3 −3 test/unit/svg.js
  107. +29 −12 test/unit/text.js
  108. +12 −0 test/unit/tiff.js
  109. +10 −32 test/unit/tile.js
  110. +1 −1 test/unit/timeout.js
  111. +19 −16 test/unit/tint.js
  112. +28 −39 test/unit/trim.js
  113. +0 −8 test/unit/util.js
62 changes: 44 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -3,25 +3,25 @@ version: 2.1
workflows:
build:
jobs:
- linux-arm64-glibc-node-14:
- linux-arm64-glibc-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-14:
- linux-arm64-musl-node-18:
filters:
tags:
only: /^v.*/
- linux-arm64-glibc-node-18:
- linux-arm64-glibc-node-20:
filters:
tags:
only: /^v.*/
- linux-arm64-musl-node-18:
- linux-arm64-musl-node-20:
filters:
tags:
only: /^v.*/

jobs:
linux-arm64-glibc-node-14:
linux-arm64-glibc-node-18:
resource_class: arm.medium
machine:
image: ubuntu-2004:current
@@ -30,13 +30,20 @@ jobs:
- 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 "curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_14.x sid main' >/etc/apt/sources.list.d/nodesource.list"
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 --unsafe-perm"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true"
linux-arm64-glibc-node-18:
- 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-2004:current
@@ -45,35 +52,54 @@ jobs:
- 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 "curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -"
sudo docker exec sharp sh -c "echo 'deb https://deb.nodesource.com/node_18.x sid main' >/etc/apt/sources.list.d/nodesource.list"
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"
linux-arm64-musl-node-14:
- 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-2004:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:14-alpine3.12
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 --unsafe-perm"
- run: sudo docker exec sharp sh -c "npm install --build-from-source"
- run: sudo docker exec sharp sh -c "npm test"
- run: "[[ -n $CIRCLE_TAG ]] && sudo docker exec --env prebuild_upload sharp sh -c \"npx prebuild --runtime napi --target 7 --upload=$prebuild_upload\" || true"
linux-arm64-musl-node-18:
- 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-2004:current
steps:
- checkout
- run: |
sudo docker run -dit --name sharp --workdir /mnt/sharp node:18-alpine3.14
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"
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@ task:
- pkg upgrade -y
- pkg install -y devel/git devel/pkgconf graphics/vips www/node20 www/npm
install_script:
- npm install --build-from-source --unsafe-perm
- npm install --build-from-source
test_script:
- npm test
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

21 changes: 16 additions & 5 deletions .github/ISSUE_TEMPLATE/installation.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ labels: installation
<!-- Please place an [x] in the box to confirm. -->

- [ ] I have read the [documentation relating to installation](https://sharp.pixelplumbing.com/install).
- [ ] I have ensured that 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.

### Are you using the latest version of sharp?

@@ -24,13 +23,25 @@ If you cannot confirm this, please upgrade to the latest version and try again b

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.

### Is this a problem with filesystem permissions?
### Are you using a supported runtime?

If you are using npm v6 or earlier and installing as a `root` or `sudo` user, have you tried with the `npm install --unsafe-perm` flag?
<!-- Please place an [x] in the relevant box to confirm. -->

If you are using npm v7 or later, does the user running `npm install` own the directory it is run in?
- [ ] I am using Node.js 18 with a version >= 18.17.0
- [ ] I am using Node.js 20 with a version >= 20.3.0
- [ ] I am using Node.js 21 or later

If you are using the `ignore-scripts` feature of `npm`, have you tried with the `npm install --ignore-scripts=false` flag?
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?

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

- [ ] I am using npm >= 9.6.5
- [ ] I am using yarn >= 3.2.0
- [ ] I am using pnpm >= 7.1.0

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

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

40 changes: 0 additions & 40 deletions .github/workflows/ci-darwin-arm64v8.yml

This file was deleted.

Loading