Skip to content

Latest commit

 

History

History
584 lines (347 loc) · 20.4 KB

File metadata and controls

584 lines (347 loc) · 20.4 KB

Change Log

12.0.0

Major Changes

  • 2ccbeeb: Drop applied-transform directives from the as=metadata output

    The as=metadata export no longer includes the applied-transform directive values (flip, quality, rotate, ...), only the final output width, height, format, the image's sharp metadata and the src. The applied transforms cannot be reconstructed from a cached file, so previously a metadata import that hit a cache entry could fail with a MISSING_EXPORT error or silently omit those fields; dropping them makes the export deterministic across cache hits and misses.

  • 2ccbeeb: Make ImageConfig a record of single-string directives, excluding output-format parameters

    ImageConfig values are now always single strings. The output-format parameters that previously kept their array values on config no longer appear in the configs at all:

    • resolveConfigs now returns an array of single-value directive records (ImageConfig[]), excluding the output-format parameters and the as output format selector that previously appeared as array values on config.
    • Transform factories and options now receive only the single-value directives, so metadata[key] is string | undefined rather than string | string[] | undefined.
    • Output format parameters and the as selector no longer affect the generated cache id, since they only influence how the already-processed image is serialized. URLs that differ only in these parameters share a single cache entry.
    • Every key in outputFormats is excluded from the configs, including custom output formats. A custom output format whose name collides with a transform directive name suppresses that directive (e.g. a custom output format named blur makes ?blur=5 stop applying the blur transform); name custom output formats to avoid directive names, since any key matching an output format is dropped from the configs.

11.0.0

Major Changes

  • 3b3c42b: breaking: ImageMetadata is no longer a flat object extending sharp's Metadata. It is now { info: { width, height, autoOrient }, transforms: AppliedTransforms }, where transforms records the values applied by each transform. Custom transforms and output formats that read or write these fields must be updated to the new shape.

    breaking: TransformOption and ImageTransformation now receive the threaded ImageMetadata as their first argument instead of reading and writing state on the sharp instance. The getMetadata/setMetadata functions and the METADATA symbol are removed. ProcessedImageMetadata is renamed ProcessedImage, TransformResult is renamed ApplyTransformsResult, and TransformState is renamed AppliedTransforms.

    Custom transforms that previously stored their own values on image[METADATA] can record them on state.transforms instead. Because AppliedTransforms is an exported interface, it can be extended from your own code via declaration merging to add typed custom fields:

    declare module 'imagetools-core' {
      interface AppliedTransforms {
        myCustomValue?: string
      }
    }

    Values written to state.transforms are included in the as=metadata output, so this also lets custom output formats consume them.

    breaking: the pixelDensityDescriptor field is removed from ImageMetadata. Pixel density descriptors are now derived on the fly from the basePixels directive and the rendered image width, so they no longer depend on the build cache and work with or without a w/h/aspect directive.

    The vite-imagetools plugin now reports the actual rendered width and height on the metadata, reconciled against the encoded output on every transformation, instead of the values declared by the transforms (which rotate never updated). The as=metadata output keeps its previous flat shape, so it is unchanged for existing users.

Patch Changes

  • 8b44393: chore: upgrade to sharp 0.35.3"

10.0.0

Major Changes

  • 987ebef: breaking: require Node 22

Patch Changes

  • 77d4925: chore: upgrade to sharp 0.35

9.1.0

Minor Changes

  • 81887b8: feat: export ImageConfig type

9.0.0

Major Changes

  • 91332bc: breaking: drop support for Node 18

8.0.0

Major Changes

  • d39cc2c: breatking: add autoOrient directive from Sharp 0.34.0, defaulting to automatically apply it to every image. An opt-out is available via noAutoOrient.

7.1.0

Minor Changes

  • 28a6e8b: chore(deps): upgrade sharp to 0.34.1

7.0.2

Patch Changes

  • c530897: fix: correctly reduce the aspect ratio when no width or height is provided

7.0.1

Patch Changes

  • 57e070e: fix: attempt to make sharp dependency declaration compatible with yarn

7.0.0

Major Changes

  • c4fdd3a: breaking: require Node 18 or newer to align with Vite and Vitest

Minor Changes

  • dc2f16f: feat: add effort directive

6.0.4

Patch Changes

  • 0eca643: chore: bump sharp to 0.33.1

6.0.3

Patch Changes

  • 5d7a77d: chore: update sharp to 0.33

6.0.2

Patch Changes

  • e0ba6c0: fix: corrected imports to compile with "moduleResolution": "nodenext"

6.0.1

Patch Changes

  • fcd7389: chore: upgrade sharp

6.0.0

Major Changes

  • c54ad96: breaking: remove utils

5.1.1

Patch Changes

  • 7bd11b7: fix: address issues when preventing upscale

5.1.0

Minor Changes

  • b84b271: feat: allow usage of all supported sharp output formats

5.0.0

Major Changes

  • 378c863: breaking: improve types
  • 378c863: breaking: simplify picture, image, and srcset output formats and remove source output format. This is both simpler and will enable pixel density descriptors

Minor Changes

  • 378c863: feat: add basePixels directive for outputting pixel density descriptors

4.1.0

Minor Changes

  • 500e4fc: feat: add lossless directive

4.0.6

Patch Changes

  • 5cbdbe8: chore: image IDs are now generated from relative filepaths instead of absolute ones

4.0.5

Patch Changes

  • 9104638: fix: address regression in resolve-configs

4.0.4

Patch Changes

  • 474170c: chore: upgrade dependencies

4.0.3

Patch Changes

  • a99c7ad: fix: use default rather than import specifier for better error message in CJS projects

4.0.2

Patch Changes

  • 75160ef: fix: correctly calculate resize metadata when given w & h
  • 815650a: fix: support node16 and nodenext values for TypeScript's moduleResolution setting

4.0.1

Patch Changes

  • 53af8fc: fix: reduce logging when providing larger image dimension via defaultDirectives

4.0.0

Major Changes

  • 45cf457: breaking: removed shorthands (e.g. webp as a standalone query parameter). You must now specify the full format=
  • 022519c: breaking: replace withoutEnlargement with allowUpscale and disable upscaling by default
  • 10ca129: breaking: drop CJS support
  • 36beecb: breaking: remove width, height, and ar directive aliases. Use w, h, and aspect instead
  • 022519c: breaking: remove withoutReduction option as there is no usecase for it
  • 45cf457: breaking: simplify ability to provide defaults. Output format is now specified with as=
  • 861276f: breaking: rename picture fallback to img

Minor Changes

  • 861276f: feat: add a new img output format

3.3.1

Patch Changes

  • c64e7ef: chore: upgrade typescript
  • 93bc23a: fix: log messages through Vite and Rollup. Allows the log level to be set with logLevel and onwarn respectively.
  • 04bd2a0: Update sharp to 0.31.3

3.3.0

Minor Changes

  • e7efc22: Add withoutEnlargment & withoutReduction directives to prevent images being enlarged or shrunk beyond der original size.

3.2.3

Patch Changes

  • dbc8d02: Fix type resolution by re-adding top-level types field

3.2.2

Patch Changes

  • 92b2fa3: chore(deps): update dependency @types/sharp to ^0.31.0
  • 80250db: Update package READMEs and metadata.
  • 60890de: fix: add an exports map

3.2.1

Patch Changes

  • ca40b8b: chore(deps): update dependency sharp to ^0.31.0

3.2.0

Minor Changes

  • 45b35da: feat: include dimensions for fallback image

3.1.1

Patch Changes

  • ea4ab8f: fix: don't include Vitest as dependency

3.1.0

Minor Changes

  • 6f93aaf: feat: add picture and source output formats

3.0.3

Patch Changes

  • 7a75a6f: Security: Update Sharp to version 0.30

3.0.2

Patch Changes

  • 64356e6: chore(deps-dev): bump sharp from 2.8.2 to 2.9.3

3.0.1

Patch Changes

  • e58e2cb: Remove icc metadata when removeMetadata is set to true.

3.0.0

Major Changes

  • f6cec96: change defaultDirectives from Record<string,string> to URLSearchParams, to align with in-code interface and to allow for multiple entries of key with multiple values

2.8.0

Minor Changes

  • c70b97e: Add metadata whitelist

2.7.6

Patch Changes

  • 0ceabff: chore(deps): bump sharp from 0.28.2 to 0.28.3

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.7.5 (2021-05-11)

Note: Version bump only for package imagetools-core

2.7.4 (2021-05-11)

Note: Version bump only for package imagetools-core

2.7.3 (2021-05-11)

Note: Version bump only for package imagetools-core

2.7.2 (2021-05-11)

Reverts

  • Revert to older sharp version (9a6ce0a)

2.7.1 (2021-05-11)

Reverts

  • Revert to older sharp version (9a6ce0a)

2.7.0 (2021-05-07)

Bug Fixes

  • Refactor & resize directive (5b2fca0), closes #91
  • update background directive (d01b446)
  • use replace with regex for older node versions (8e86de1)

Features

  • Allow # symbols in src urls (b5beedd)
  • Allow ImageTransform functions to be async (da3e726), closes #88

2.6.0 (2021-05-07)

Bug Fixes

  • update background directive (d01b446)
  • use replace with regex for older node versions (8e86de1)

Features

  • Allow # symbols in src urls (b5beedd)
  • Allow ImageTransform functions to be async (da3e726), closes #88

2.5.0 (2021-05-07)

Features

  • Allow ImageTransform functions to be async (da3e726), closes #88

2.3.3 (2021-05-03)

Note: Version bump only for package imagetools-core

2.3.2 (2021-05-03)

Note: Version bump only for package imagetools-core

2.3.1 (2021-04-28)

Bug Fixes

  • include private metadata when applying the transforms (cc46d1b)

2.3.0 (2021-04-28)

Bug Fixes

  • exclude test files from generated types (a86d29c)

Features

  • Add aspect ratio support to the resize directive (#71) (8e905da)
  • Adding ar shorthand for aspect and support for numeric values for aspect (#74) (e96b7e3)

2.2.0 (2021-04-28)

Bug Fixes

  • exclude test files from generated types (a86d29c)

Features

  • Add aspect ratio support to the resize directive (#71) (8e905da)
  • Adding ar shorthand for aspect and support for numeric values for aspect (#74) (e96b7e3)

2.1.0 (2021-04-28)

Bug Fixes

  • exclude test files from generated types (a86d29c)

Features

  • Add aspect ratio support to the resize directive (#71) (8e905da)
  • Adding ar shorthand for aspect and support for numeric values for aspect (#74) (e96b7e3)

2.0.0 (2021-04-12)

Note: Version bump only for package imagetools-core

0.1.0 (2021-04-12)

Note: Version bump only for package imagetools-core

0.1.0-next.16 (2021-04-11)

Note: Version bump only for package imagetools-core

0.1.0-next.15 (2021-04-11)

Note: Version bump only for package imagetools-core

0.1.0-next.14 (2021-04-11)

Note: Version bump only for package imagetools-core

0.1.0-next.13 (2021-04-06)

Note: Version bump only for package imagetools-core

0.1.0-next.12 (2021-04-05)

Note: Version bump only for package imagetools-core

0.1.0-next.11 (2021-03-30)

Note: Version bump only for package imagetools-core

0.1.0-next.10 (2021-03-30)

Bug Fixes

  • cache key generation (e09434c)
  • support nodejs LTS versions (4abccc5), closes #51
  • update cache key geneartion to match spec (7f0a0e8)

Features

  • allow metadata removal to be toggled by option (5d0c781)

0.1.0-next.9 (2021-03-30)

Bug Fixes

  • support nodejs LTS versions (4abccc5), closes #51

0.1.0-next.8 (2021-03-19)

Features

  • imagetools-core: Add image id generation utility (9e0673d)

0.1.0-next.7 (2021-03-16)

Bug Fixes

  • readd metadata annotations (afa0b4b)

0.1.0-next.6 (2021-03-15)

Note: Version bump only for package imagetools-core

0.1.0-next.5 (2021-03-15)

Note: Version bump only for package imagetools-core

0.1.0-next.4 (2021-03-15)

Note: Version bump only for package imagetools-core

0.1.0-next.3 (2021-03-15)

Bug Fixes

0.1.0-next.2 (2021-03-15)

Note: Version bump only for package imagetools-core

0.1.0-next.1 (2021-03-15)

Note: Version bump only for package imagetools-core

0.1.0-next.0 (2021-03-15)

Bug Fixes

  • blur directive argument parsing (e48448d)
  • consolidate functions into main (0772934)

Features

Reverts