Skip to content

Version 0.5.0

Choose a tag to compare

@kondratevdev kondratevdev released this 03 Nov 08:40
· 76 commits to master since this release
42fa0bf

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 Watermark factories for anchor positions and repeated tiling
    with optional spacing, #120
  • Crop, Extend, and ExtendAspectRatio now accept Gravity instances
    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() and Expires.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, and Background factories 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 Gravity factories 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_name with 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 inherit None, #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 with pip install 'imgproxykit[drf]', #77

Breaking changes

  • Removed string gravity codes and separate offset_x / offset_y arguments
    from Crop, Extend, and ExtendAspectRatio. Pass a Gravity instance,
    such as gravity=Gravity.center(offset_x=10), instead, #120
  • Renamed imgproxykit.types.Position to GravityType.
    Gravity is now generic and final; subclassing is no longer supported, #120
  • PathSerializer now requires the source_encoding keyword-only argument.
    Custom path serializer constructors must accept it. Pass 'base64' to
    retain the previous source URL representation, #106
  • Renamed arguments_separator to argument_separator,
    and unsigned_signature to unsigned_marker in Client, 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
  • PathSerializer now requires the use_short_options
    keyword-only argument, #80

Misc

  • Reworked documentation and added a Django Modern REST integration example, #109

New Contributors

Full Changelog: v0.4.0...v0.5.0