@thi.ng/imago 1.5.9 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/api.d.ts +7 -0
  2. package/package.json +15 -15
  3. package/proc.js +3 -1
package/api.d.ts CHANGED
@@ -434,6 +434,13 @@ export interface ImgProcOpts {
434
434
  * Base directory for {@link output} steps
435
435
  */
436
436
  outDir: string;
437
+ /**
438
+ * Only used when loading images from file or buffer. Auto-orients the image
439
+ * based on the EXIF `Orientation` tag, if present.
440
+ *
441
+ * @defaultValue true
442
+ */
443
+ autoOrient: boolean;
437
444
  /**
438
445
  * By default all input metadata will be lost in the output(s). If this
439
446
  * option is enabled, keeps existing EXIF data and attaches it to output
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/imago",
3
- "version": "1.5.9",
3
+ "version": "1.6.0",
4
4
  "description": "JSON & API-based declarative and extensible image processing trees/pipelines",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -40,22 +40,22 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.12.15",
44
- "@thi.ng/blurhash": "^1.0.37",
45
- "@thi.ng/checks": "^3.8.5",
46
- "@thi.ng/date": "^2.7.78",
47
- "@thi.ng/defmulti": "^3.0.91",
48
- "@thi.ng/errors": "^2.6.4",
49
- "@thi.ng/file-io": "^2.2.25",
50
- "@thi.ng/logger": "^3.2.14",
51
- "@thi.ng/object-utils": "^1.3.7",
52
- "@thi.ng/pixel": "^7.5.24",
53
- "@thi.ng/pixel-dither": "^1.1.192",
54
- "@thi.ng/prefixes": "^2.3.66",
43
+ "@thi.ng/api": "^8.12.16",
44
+ "@thi.ng/blurhash": "^1.0.38",
45
+ "@thi.ng/checks": "^3.8.6",
46
+ "@thi.ng/date": "^2.7.79",
47
+ "@thi.ng/defmulti": "^3.0.92",
48
+ "@thi.ng/errors": "^2.6.5",
49
+ "@thi.ng/file-io": "^2.2.26",
50
+ "@thi.ng/logger": "^3.2.15",
51
+ "@thi.ng/object-utils": "^1.3.8",
52
+ "@thi.ng/pixel": "^7.5.25",
53
+ "@thi.ng/pixel-dither": "^1.1.193",
54
+ "@thi.ng/prefixes": "^2.3.67",
55
55
  "sharp": "^0.34.5"
56
56
  },
57
57
  "devDependencies": {
58
- "@thi.ng/vectors": "^8.6.21",
58
+ "@thi.ng/vectors": "^8.6.22",
59
59
  "@types/node": "^24.10.9",
60
60
  "esbuild": "^0.27.2",
61
61
  "typedoc": "^0.28.16",
@@ -193,5 +193,5 @@
193
193
  "status": "alpha",
194
194
  "year": 2024
195
195
  },
196
- "gitHead": "8f50352caab9ec7757d645c0afa605dfb5427abe\n"
196
+ "gitHead": "1d279469d3bd787d5af294cc1f9463f46f7d2fd9\n"
197
197
  }
package/proc.js CHANGED
@@ -21,7 +21,9 @@ import { rotateProc } from "./ops/rotate.js";
21
21
  import { ensureSize, isIntBufferLike } from "./utils.js";
22
22
  const LOGGER = ROOT.childLogger("imgproc");
23
23
  const processImage = async (src, specs, opts = {}, parentCtx) => {
24
- let img = isString(src) || isArrayBufferView(src) ? sharp(src) : isIntBufferLike(src) ? sharp(new Uint8Array(src.data.buffer), {
24
+ let img = isString(src) || isArrayBufferView(src) ? sharp(src, {
25
+ autoOrient: opts.autoOrient !== false
26
+ }) : isIntBufferLike(src) ? sharp(new Uint8Array(src.data.buffer), {
25
27
  raw: {
26
28
  width: src.width,
27
29
  height: src.height,