Repository navigation
v0.2.1
What's Changed
Breaking changes
- Replaced the
presetsargument ofClient.urlandPathBuilder
with thePresetoption, which can be combined with other
processing options inTransform, #12 - Removed the
formatargument ofClient.url, theoutput_format
argument ofPathBuilder, and theTransform.formatattribute.
UseTransform(Format('webp'))orTransform(format='webp')instead.
Output formats are now serialized as processing options,
likeformat:webp, instead of source URL extensions, #12 and #18 Transformnow accepts option instances as positional arguments
instead of anoptionstuple. Replace
Transform(options=(Resize(width=300), Quality(85)))
withTransform(Resize(width=300), Quality(85)), #14- Removed
imgproxykit.builders.PathBuilder, use
imgproxykit.serialization.PathSerializerinstead.
RenamedClient.path_builder_clstoClient.path_serializer_cls - Renamed
imgproxykit.signing.URLSignertoUrlSigner
andClient.signer_clstoClient.url_signer_cls, #15 - Removed
imgproxykit.types.EMPTY. Omitted option arguments,
signing credentials, and transforms now default toNone.
UseNoneinstead ofEMPTYwhen explicitly omitting a value - Processing options now use full imgproxy names, like
resize,
width, andquality, instead ofrs,w, andq.
This changes generated URLs and their signatures.
OptionTypenow lists full names as well, #19 - Custom options must now define
nameas a class attribute
instead of_name
Features
- Added
unsigned_signatureparameter toClientandUrlSigner
to customize the unsigned URL marker, defaults tounsafe, #6 - Added
signature_sizeparameter toClientandUrlSigner
to truncate signatures to matchIMGPROXY_SIGNATURE_SIZE, #6 - Added scalar keyword arguments to
Transform, like
Transform(width=300, quality=85, format='webp').
They are appended after positional options in keyword order, #20 - Added
ScalarOptionbase class for single-value options.
Subclasses are registered by processing option name and can be
constructed withScalarOption.from_kwarg, #20 - All single-value options now accept positional values,
likeBlur(2)andRotate(90), #14 - Added
Option.validatehook, called when an option is constructed,
for custom argument validation - Processing option classes can now be subclassed
- Added
tytype checking to local checks and CI, #22
Bugfixes
- Fixed northwest and southwest position codes in
Position
andWatermarkPosition: usenoweandsowe
instead of the invalidnowandsow
Misc
- Added API Reference documentation for the public API, #5
- Added integration tests against an imgproxy server using Docker,
covering processing options, presets, signing, and source URLs - Expanded unit tests and enabled doctests for docstrings,
documentation, andREADME.md, #7
Full Changelog: v0.1.0...v0.2.1