Repository navigation
Releases
Releases · wemake-services/imgproxykit
Version 0.7.0
What's Changed
Features
- Added
Client(only_presets=True)to generate URLs for servers running
withIMGPROXY_ONLY_PRESETS. AcceptsPresetoptions with an optional
Format, serialized as a source suffix. Also available in Django client
settings, #198 - Added customizable
TransformSerializer,PresetsSerializer,
OptionSerializer, andSourceSerializercomponents for path
serialization, #198 - Support Python 3.12
typealiases, alias chains, and generic aliases
in dataclass variant declarations, #179 KeywordOptionResolver.from_kwarg()now preserves the input value type
in itsScalarOptionreturn annotation, #138
Breaking changes
PathSerializernow requires theonly_presetskeyword-only argument.
PassFalseto retain normal processing option serialization, and update
custom path serializer constructors to accept it. Direct calls now also
requiretransform; passNonefor no transformation, #198- Moved
KeywordOptionsandKeywordOptionResolverfrom
imgproxykit.keyword_optionstoimgproxykit.transform.
Update imports to use the new module;imgproxykit.keyword_options
has been removed, #138
New Contributors
- @rise11hx-cmyk made their first contribution in #179
Full Changelog: v0.6.0...v0.7.0
Version 0.6.0
What's Changed
Features
- Added
Transform.keyword_option_resolver_clsto customize how built-in
keyword options are constructed.Transform.extend()preserves the
subclass and its resolver, #136 - Added Litestar integration with
ImgproxyPlugin. Install with
pip install 'imgproxykit[litestar]', #130 - Added dataclass variant declarations to Django's
imgproxy_variants()
andIMGPROXYKIT['variants']. Passing a class directly returns a typed
instance; named sets always return dictionaries. DRF's
ImgproxyVariantsFieldaccepts the same declarations and returns
dictionaries of URLs, #127
Breaking changes
- Renamed the
cachebusterkeyword tocache_busterinTransformand
Transform.extend(), #136 - Reserved transform keyword arguments for built-in options. Pass custom
ScalarOptionsubclasses as positional instances, #136 - Replaced
imgproxykit.transform.ScalarOptionswith
imgproxykit.keyword_options.KeywordOptions, #136 - Removed
ScalarOption.from_kwarg(). UseKeywordOptionResolver.from_kwarg()
for built-in keywords, #136 - Removed the
Option.validatehook. imgproxy validates processing option
values when it handles the generated URL, #131
Misc
- Documented how to define custom processing options with
ScalarOption
andOption, with an example combining them with built-in keywords, #136 - Updated Django, DRF, FastAPI, and DMR integration guides with tabbed
examples for transformations and variant declarations, #127 - Improved the user guide with grouped processing option tables linking to
the API reference and imgproxy documentation, tabbed variant examples,
and shared collapsible instructions for running imgproxy locally, #125
Full Changelog: v0.5.0...v0.6.0
Version 0.5.0
Introduction
Hi everyone!
imgproxykit 0.5.0 is the first release with a fairly stable API. There will probably still be breaking changes, but I don’t expect major changes to the architecture.
Thanks to everyone who supports the project, tries the library, shares ideas, and reports issues. Your feedback helps a lot!
What's Changed
Features
- Added
Watermarkfactories for anchor positions and repeated tiling
with optional spacing, #120 Crop,Extend, andExtendAspectRationow acceptGravityinstances
to configure anchors and offsets. Gravity types prevent using smart
gravity for canvas extension during static type checking, #120- Added
Trim.transparent()to trim transparent borders with optional
symmetry flags without specifying imgproxy's transparency key color, #119 - Added
Expires.at()andExpires.after()factories for timezone-aware
deadlines and relative lifetimes, #118 - Added dataclass support to
Client.variants(): declare URL fields with
Annotated[str, Transform(...)]and pass the class to receive a typed
instance, #108 - Added
Resize,Padding, andBackgroundfactories to select resizing
strategies, configure uniform or symmetric padding, and set or explicitly
disable background colors, #107 - Added
Client(source_encoding='plain')to generate URLs with
percent-encoded sources and imgproxy's/plain/marker. Base64 remains
the default, #106 - Added
Gravityfactories to configure crop positioning without
using protocol codes, #104 - Added
Transform.extend()to create a new transformation with additional
typed options and scalar keyword arguments, preserving the original, #103 - Added
Option.short_namewith documented processing option aliases and
Client(use_short_options=True)to use them in URLs. Full names remain
the default; options without a separate alias inheritNone, #79 - Added Django REST Framework integration with read-only serializer fields
for image URLs and named variants. Reuses Django settings, transformations,
and source resolution. Supports source strings and model file fields.
Install withpip install 'imgproxykit[drf]', #77
Breaking changes
- Removed string gravity codes and separate
offset_x/offset_yarguments
fromCrop,Extend, andExtendAspectRatio. Pass aGravityinstance,
such asgravity=Gravity.center(offset_x=10), instead, #120 - Renamed
imgproxykit.types.PositiontoGravityType.
Gravityis now generic and final; subclassing is no longer supported, #120 PathSerializernow requires thesource_encodingkeyword-only argument.
Custom path serializer constructors must accept it. Pass'base64'to
retain the previous source URL representation, #106- Renamed
arguments_separatortoargument_separator,
andunsigned_signaturetounsigned_markerinClient, its serializer
and signer components, and Django client settings. Update keyword arguments,
Django settings, and custom component constructors to use the new names, #102 - Removed
imgproxykit.types.OptionType. Processing option names now use
str, allowing custom options to define their own protocol names, #79 PathSerializernow requires theuse_short_options
keyword-only argument, #80
Misc
- Reworked documentation and added a Django Modern REST integration example, #109
New Contributors
- @milssky made their first contribution in #74
- @Vijaysir0hi made their first contribution in #89
- @hamid-digitalmarketer made their first contribution in #90
- @HarshRajSinghania made their first contribution in #85
Full Changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
Features
- Added Django integration to configure clients through Django settings
and generate image URLs and named variants with Python shortcuts
and template tags. Supports model file fields, reusable named
transformations, and custom source resolvers.
Install withpip install 'imgproxykit[django]', #66 - Added FastAPI integration with support for multiple named clients.
Install withpip install 'imgproxykit[fastapi]', #64 - Added
Client.variantsto generate named image URLs for a single source
from a mapping of complete transformations. The returned dictionary
preserves the names, order, and types of variant keys,
including literal string unions, #59
Misc
- Added runnable examples to the user guide and API reference, #62
- Added a Variants guide covering reusable transformation sets and typed
variant names, with examples of transformation composition.
Updated theREADMEandGetting startedto focus on local sources
and named variants, #59
Full Changelog: v0.3.0...v0.4.0
v0.3.0
What's Changed
Breaking changes
- Configuration defaults now live only in
Client. Direct construction of
PathSerializerrequiresarguments_separator;UrlSignerrequires
key,salt,signature_size, andunsigned_signature.
Passkey=Noneandsalt=Nonefor unsigned signing.Clientdefaults
are unchanged, #57 Presetnow takes preset names as positional arguments, so
Preset('thumbnail', 'watermarked')replaces
Preset(names=('thumbnail', 'watermarked')). Supplied names keep their
order, #27- Added
arguments_separatorparameter toClientandPathSerializer
to matchIMGPROXY_ARGUMENTS_SEPARATOR, defaults to:.
Clientnow passes it topath_serializer_cls, so custom path serializer
constructors must accept this keyword argument, #26
Misc
- Switched documentation to Sphinx-Immaterial with built-in tabs,
highlighted API signatures, and streamlined navigation, #58 - Added issue and pull request templates, an AI policy,
and updated contribution guidelines, #56 - Clarified source and imgproxy URLs with consistent naming across
documentation examples. Expanded type documentation and added links
to the API reference and imgproxy settings, #54
New Contributors
- @sobolevn made their first contribution in #33
- @tyza66 made their first contribution in #37
- @Peopl3s made their first contribution in #40
Full Changelog: v0.2.1...v0.3.0
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
v0.1.0
What's Changed
Initial release of imgproxykit — a typed Python toolkit for building imgproxy URLs.
- Immutable, reusable image transforms.
- Typed processing options for resizing, cropping, quality, watermarks, and more.
- Output format selection, including WebP and AVIF.
- Support for server-side presets.
- Automatic URL signing with an imgproxy key and salt.
- Python 3.12+ support.
New Contributors
- @dependabot[bot] made their first contribution in #4
Full Changelog: https://github.com/kondratevdev/imgproxykit/commits/v0.1.0