-
2ccbeeb: Drop applied-transform directives from the
as=metadataoutputThe
as=metadataexport no longer includes the applied-transform directive values (flip,quality,rotate, ...), only the final outputwidth,height,format, the image's sharp metadata and thesrc. The applied transforms cannot be reconstructed from a cached file, so previously a metadata import that hit a cache entry could fail with aMISSING_EXPORTerror or silently omit those fields; dropping them makes the export deterministic across cache hits and misses. -
2ccbeeb: Make
ImageConfiga record of single-string directives, excluding output-format parametersImageConfigvalues are now always single strings. The output-format parameters that previously kept their array values onconfigno longer appear in the configs at all:resolveConfigsnow returns an array of single-value directive records (ImageConfig[]), excluding the output-format parameters and theasoutput format selector that previously appeared as array values onconfig.- Transform factories and options now receive only the single-value directives, so
metadata[key]isstring | undefinedrather thanstring | string[] | undefined. - Output format parameters and the
asselector 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
outputFormatsis 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 namedblurmakes?blur=5stop applying the blur transform); name custom output formats to avoid directive names, since any key matching an output format is dropped from the configs.
-
3b3c42b: breaking:
ImageMetadatais no longer a flat object extending sharp'sMetadata. It is now{ info: { width, height, autoOrient }, transforms: AppliedTransforms }, wheretransformsrecords 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:
TransformOptionandImageTransformationnow receive the threadedImageMetadataas their first argument instead of reading and writing state on the sharp instance. ThegetMetadata/setMetadatafunctions and theMETADATAsymbol are removed.ProcessedImageMetadatais renamedProcessedImage,TransformResultis renamedApplyTransformsResult, andTransformStateis renamedAppliedTransforms.Custom transforms that previously stored their own values on
image[METADATA]can record them onstate.transformsinstead. BecauseAppliedTransformsis an exportedinterface, 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.transformsare included in theas=metadataoutput, so this also lets custom output formats consume them.breaking: the
pixelDensityDescriptorfield is removed fromImageMetadata. Pixel density descriptors are now derived on the fly from thebasePixelsdirective and the rendered image width, so they no longer depend on the build cache and work with or without aw/h/aspectdirective.The
vite-imagetoolsplugin 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 (whichrotatenever updated). Theas=metadataoutput keeps its previous flat shape, so it is unchanged for existing users.
- 8b44393: chore: upgrade to sharp 0.35.3"
- 987ebef: breaking: require Node 22
- 77d4925: chore: upgrade to sharp 0.35
- 81887b8: feat: export
ImageConfigtype
- 91332bc: breaking: drop support for Node 18
- d39cc2c: breatking: add
autoOrientdirective from Sharp 0.34.0, defaulting to automatically apply it to every image. An opt-out is available vianoAutoOrient.
- 28a6e8b: chore(deps): upgrade sharp to 0.34.1
- c530897: fix: correctly reduce the aspect ratio when no width or height is provided
- 57e070e: fix: attempt to make sharp dependency declaration compatible with yarn
- c4fdd3a: breaking: require Node 18 or newer to align with Vite and Vitest
- dc2f16f: feat: add effort directive
- 0eca643: chore: bump sharp to 0.33.1
- 5d7a77d: chore: update sharp to 0.33
- e0ba6c0: fix: corrected imports to compile with
"moduleResolution": "nodenext"
- fcd7389: chore: upgrade sharp
- c54ad96: breaking: remove utils
- 7bd11b7: fix: address issues when preventing upscale
- b84b271: feat: allow usage of all supported sharp output formats
- 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
- 378c863: feat: add
basePixelsdirective for outputting pixel density descriptors
- 500e4fc: feat: add lossless directive
- 5cbdbe8: chore: image IDs are now generated from relative filepaths instead of absolute ones
- 9104638: fix: address regression in resolve-configs
- 474170c: chore: upgrade dependencies
- a99c7ad: fix: use default rather than import specifier for better error message in CJS projects
- 75160ef: fix: correctly calculate resize metadata when given w & h
- 815650a: fix: support
node16andnodenextvalues for TypeScript'smoduleResolutionsetting
- 53af8fc: fix: reduce logging when providing larger image dimension via defaultDirectives
- 45cf457: breaking: removed shorthands (e.g. webp as a standalone query parameter). You must now specify the full
format= - 022519c: breaking: replace
withoutEnlargementwithallowUpscaleand 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
withoutReductionoption 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
- 861276f: feat: add a new img output format
- c64e7ef: chore: upgrade typescript
- 93bc23a: fix: log messages through Vite and Rollup. Allows the log level to be set with
logLevelandonwarnrespectively. - 04bd2a0: Update sharp to 0.31.3
- e7efc22: Add
withoutEnlargment&withoutReductiondirectives to prevent images being enlarged or shrunk beyond der original size.
- dbc8d02: Fix type resolution by re-adding top-level types field
- 92b2fa3: chore(deps): update dependency @types/sharp to ^0.31.0
- 80250db: Update package READMEs and metadata.
- 60890de: fix: add an exports map
- ca40b8b: chore(deps): update dependency sharp to ^0.31.0
- 45b35da: feat: include dimensions for fallback image
- ea4ab8f: fix: don't include Vitest as dependency
- 6f93aaf: feat: add picture and source output formats
- 7a75a6f: Security: Update Sharp to version 0.30
- 64356e6: chore(deps-dev): bump sharp from 2.8.2 to 2.9.3
- e58e2cb: Remove
iccmetadata whenremoveMetadatais set to true.
- f6cec96: change
defaultDirectivesfromRecord<string,string>toURLSearchParams, to align with in-code interface and to allow for multiple entries of key with multiple values
- c70b97e: Add metadata whitelist
- 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)
- Revert to older sharp version (9a6ce0a)
2.7.1 (2021-05-11)
- Revert to older sharp version (9a6ce0a)
2.7.0 (2021-05-07)
- Refactor & resize directive (5b2fca0), closes #91
- update background directive (d01b446)
- use replace with regex for older node versions (8e86de1)
- Allow # symbols in src urls (b5beedd)
- Allow ImageTransform functions to be async (da3e726), closes #88
2.6.0 (2021-05-07)
- Allow # symbols in src urls (b5beedd)
- Allow ImageTransform functions to be async (da3e726), closes #88
2.5.0 (2021-05-07)
2.3.3 (2021-05-03)
Note: Version bump only for package imagetools-core
Note: Version bump only for package imagetools-core
2.3.1 (2021-04-28)
- include private metadata when applying the transforms (cc46d1b)
2.3.0 (2021-04-28)
- exclude test files from generated types (a86d29c)
- Add aspect ratio support to the resize directive (#71) (8e905da)
- Adding
arshorthand for aspect and support for numeric values for aspect (#74) (e96b7e3)
2.2.0 (2021-04-28)
- exclude test files from generated types (a86d29c)
- Add aspect ratio support to the resize directive (#71) (8e905da)
- Adding
arshorthand for aspect and support for numeric values for aspect (#74) (e96b7e3)
2.1.0 (2021-04-28)
- exclude test files from generated types (a86d29c)
- Add aspect ratio support to the resize directive (#71) (8e905da)
- Adding
arshorthand 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
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
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)
- cache key generation (e09434c)
- support nodejs LTS versions (4abccc5), closes #51
- update cache key geneartion to match spec (7f0a0e8)
- allow metadata removal to be toggled by option (5d0c781)
0.1.0-next.9 (2021-03-30)
0.1.0-next.8 (2021-03-19)
- imagetools-core: Add image id generation utility (9e0673d)
0.1.0-next.7 (2021-03-16)
- 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)
- fix imagetools core (5a09e00)
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
- Revert "Publish" (c0186f1)