Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into reset-exif
Browse files Browse the repository at this point in the history
# Conflicts:
#	yarn.lock
  • Loading branch information
hipstersmoothie committed Feb 23, 2024
2 parents 723424e + 65e3792 commit edfd4ae
Show file tree
Hide file tree
Showing 46 changed files with 2,639 additions and 3,121 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,15 @@
"contributions": [
"code"
]
},
{
"login": "AnotherPillow",
"name": "AnotherPillow",
"avatar_url": "https://avatars.githubusercontent.com/u/85362273?v=4",
"profile": "https://github.com/AnotherPillow",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# v0.22.11 (Fri Feb 23 2024)

:tada: This release contains work from new contributors! :tada:

Thanks for all your work!

:heart: Rob Juurlink ([@kozmoz](https://github.com/kozmoz))

:heart: null[@AnotherPillow](https://github.com/AnotherPillow)

#### 🚀 Enhancement

- `@jimp/plugin-print`
- Add \n support for image.print #865 [#1265](https://github.com/jimp-dev/jimp/pull/1265) (juurr00@juurlink.org [@kozmoz](https://github.com/kozmoz) [@hipstersmoothie](https://github.com/hipstersmoothie))

#### 📝 Documentation

- `jimp`
- Fix it's/its, see description. [#1267](https://github.com/jimp-dev/jimp/pull/1267) ([@AnotherPillow](https://github.com/AnotherPillow))

#### Authors: 4

- [@AnotherPillow](https://github.com/AnotherPillow)
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
- juurr00 (juurr00@juurlink.org)
- Rob Juurlink ([@kozmoz](https://github.com/kozmoz))

---

# v0.22.10 (Wed Jul 26 2023)

:tada: This release contains work from a new contributor! :tada:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png">
<h1>Jimp</h1>
<p>JavaScript Image Manipulation Program</p>
<p>An image processing library for Node written entirely in JavaScript, with zero native dependencies.</p>
<p>An image processing library for Node written entirely in JavaScript, with zero native dependencies</p>
</div>

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -309,6 +309,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/JunkMeal"><img src="https://avatars.githubusercontent.com/u/65283415?v=4?s=100" width="100px;" alt=""/><br /><sub><b>JunkMeal</b></sub></a><br /><a href="https://github.com/jimp-dev/jimp/commits?author=JunkMeal" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Marsup"><img src="https://avatars.githubusercontent.com/u/796194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nicolas Morel</b></sub></a><br /><a href="https://github.com/jimp-dev/jimp/commits?author=Marsup" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/stevezac-osu"><img src="https://avatars.githubusercontent.com/u/71655313?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zach Stevenson</b></sub></a><br /><a href="https://github.com/jimp-dev/jimp/commits?author=stevezac-osu" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/AnotherPillow"><img src="https://avatars.githubusercontent.com/u/85362273?v=4?s=100" width="100px;" alt=""/><br /><sub><b>AnotherPillow</b></sub></a><br /><a href="https://github.com/jimp-dev/jimp/commits?author=AnotherPillow" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
6 changes: 3 additions & 3 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"lerna": "2.11.0",
"lerna": "^7.1.4",
"npmClient": "yarn",
"registry": "https://registry.npmjs.org/",
"useWorkspaces": true,
"version": "0.22.10"
"version": "0.22.11",
"packages": ["packages/*"]
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"postinstall": "patch-package"
},
"devDependencies": {
"@auto-it/all-contributors": "^10.38.4",
"@auto-it/first-time-contributor": "^10.38.4",
"@auto-it/magic-zero": "^10.38.4",
"@auto-it/protected-branch": "^10.38.4",
"@auto-it/all-contributors": "^11.0.5",
"@auto-it/first-time-contributor": "^11.0.5",
"@auto-it/magic-zero": "^11.0.5",
"@auto-it/protected-branch": "^11.0.5",
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
Expand All @@ -40,7 +40,7 @@
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"all-contributors-cli": "^6.24.0",
"auto": "^10.38.4",
"auto": "^11.0.5",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-source-map-support": "^2.2.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
Expand All @@ -59,7 +59,7 @@
"karma-firefox-launcher": "^1.2.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"lerna": "^3.16.4",
"lerna": "^7.1.4",
"lint-staged": "^9.2.5",
"mocha": "^6.2.0",
"nyc": "^14.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/core",
"version": "0.22.10",
"version": "0.22.11",
"description": "Jimp core",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
38 changes: 14 additions & 24 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,6 @@ class Jimp extends EventEmitter {
if (typeof x !== "number" || typeof y !== "number")
return throwError.call(this, "x and y must be numbers", cb);

// round input
x = Math.round(x);
y = Math.round(y);

const idx = this.getPixelIndex(x, y);
const hex = this.bitmap.data.readUInt32BE(idx);

Expand Down Expand Up @@ -771,10 +767,6 @@ class Jimp extends EventEmitter {
)
return throwError.call(this, "hex, x and y must be numbers", cb);

// round input
x = Math.round(x);
y = Math.round(y);

const idx = this.getPixelIndex(x, y);
this.bitmap.data.writeUInt32BE(hex, idx);

Expand All @@ -792,14 +784,12 @@ class Jimp extends EventEmitter {
* @return {boolean} hasAlpha whether the image contains opaque pixels
*/
hasAlpha() {
for (let yIndex = 0; yIndex < this.bitmap.height; yIndex++) {
for (let xIndex = 0; xIndex < this.bitmap.width; xIndex++) {
const idx = (this.bitmap.width * yIndex + xIndex) << 2;
const alpha = this.bitmap.data[idx + 3];
const { width, height, data } = this.bitmap;
const byteLen = (width * height) << 2;

if (alpha !== 0xff) {
return true;
}
for (let idx = 3; idx < byteLen; idx += 4) {
if (data[idx] !== 0xff) {
return true;
}
}

Expand Down Expand Up @@ -905,16 +895,16 @@ Jimp.rgbaToInt = function (r, g, b, a, cb) {
return throwError.call(this, "a must be between 0 and 255", cb);
}

r = Math.round(r);
b = Math.round(b);
g = Math.round(g);
a = Math.round(a);
let i = r & 0xff;
i <<= 8;
i |= g & 0xff;
i <<= 8;
i |= b & 0xff;
i <<= 8;
i |= a & 0xff;

const i =
r * Math.pow(256, 3) +
g * Math.pow(256, 2) +
b * Math.pow(256, 1) +
a * Math.pow(256, 0);
// Ensure sign is correct
i >>>= 0;

if (isNodePattern(cb)) {
cb.call(this, null, i);
Expand Down
29 changes: 12 additions & 17 deletions packages/core/src/modules/phash.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,19 @@ ImagePHash.prototype.getHash = function (img) {

// DCT function stolen from http://stackoverflow.com/questions/4240490/problems-with-dct-and-idct-algorithm-in-java

/**
Convert a 32-bit integer color value to an RGBA object.
*/
function intToRGBA(i) {
const rgba = {};

rgba.r = Math.floor(i / Math.pow(256, 3));
rgba.g = Math.floor((i - rgba.r * Math.pow(256, 3)) / Math.pow(256, 2));
rgba.b = Math.floor(
(i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2)) /
Math.pow(256, 1)
);
rgba.a = Math.floor(
(i -
rgba.r * Math.pow(256, 3) -
rgba.g * Math.pow(256, 2) -
rgba.b * Math.pow(256, 1)) /
Math.pow(256, 0)
);

return rgba;
const a = i & 0xff;
i >>>= 8;
const b = i & 0xff;
i >>>= 8;
const g = i & 0xff;
i >>>= 8;
const r = i & 0xff;

return { r, g, b, a };
}

const c = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/custom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/custom",
"version": "0.22.10",
"version": "0.22.11",
"description": "Interface to customize jimp configuration",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
16 changes: 16 additions & 0 deletions packages/jimp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# v0.22.11 (Fri Feb 23 2024)

:tada: This release contains work from a new contributor! :tada:

Thank you, null[@AnotherPillow](https://github.com/AnotherPillow), for all your work!

#### 📝 Documentation

- Fix it's/its, see description. [#1267](https://github.com/jimp-dev/jimp/pull/1267) ([@AnotherPillow](https://github.com/AnotherPillow))

#### Authors: 1

- [@AnotherPillow](https://github.com/AnotherPillow)

---

# v0.22.9 (Wed Jul 26 2023)

:tada: This release contains work from a new contributor! :tada:
Expand Down
2 changes: 1 addition & 1 deletion packages/jimp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jimp",
"version": "0.22.10",
"version": "0.22.11",
"description": "An image processing library written entirely in JavaScript (i.e. zero external or native dependencies)",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-blit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-blit",
"version": "0.22.10",
"version": "0.22.11",
"description": "Blit an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-blur/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-blur",
"version": "0.22.10",
"version": "0.22.11",
"description": "blur an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-circle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-circle",
"version": "0.22.10",
"version": "0.22.11",
"description": "Creates a circle out of an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-color/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-color",
"version": "0.22.10",
"version": "0.22.11",
"description": "Bitmap manipulation to adjust the color in an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-contain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-contain",
"version": "0.22.10",
"version": "0.22.11",
"description": "contain an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-cover/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-cover",
"version": "0.22.10",
"version": "0.22.11",
"description": "cover an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-crop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-crop",
"version": "0.22.10",
"version": "0.22.11",
"description": "crop an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-displace/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-displace",
"version": "0.22.10",
"version": "0.22.11",
"description": "displace an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-dither/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-dither",
"version": "0.22.10",
"version": "0.22.11",
"description": "Dither an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-fisheye/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-fisheye",
"version": "0.22.10",
"version": "0.22.11",
"description": "Apply a fisheye effect to an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-flip/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-flip",
"version": "0.22.10",
"version": "0.22.11",
"description": "flip an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-gaussian/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-gaussian",
"version": "0.22.10",
"version": "0.22.11",
"description": "gaussian blur an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-invert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-invert",
"version": "0.22.10",
"version": "0.22.11",
"description": "invert an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-mask/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-mask",
"version": "0.22.10",
"version": "0.22.11",
"description": "mask an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-normalize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jimp/plugin-normalize",
"version": "0.22.10",
"version": "0.22.11",
"description": "normalize an image.",
"main": "dist/index.js",
"module": "es/index.js",
Expand Down

0 comments on commit edfd4ae

Please sign in to comment.