plone.scale


Nameplone.scale JSON
Version 4.1.0 PyPI version JSON
download
home_pagehttps://pypi.org/project/plone.scale
SummaryImage scaling
upload_time2023-10-25 10:19:45
maintainer
docs_urlhttps://pythonhosted.org/plone.scale/
authorPlone Foundation
requires_python>=3.8
licenseBSD
keywords image scaling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============

This package contains image scaling logic for use in Zope environments. It
supports Zope 2, grok and other systems build on using the Zope ToolKit (ZTK).

Several design goals were used when writing this package:

- image scaling to any width, height, width&height should be supported
  using both up-scaling and down-scaling. Scaling parameters should never
  be fixed in code. This allows designers to use any image scale they want
  without having to modify python code.

- the result of scaling will be an image along with its new size, not a
  HTML or XHTML tag. We already have excellent tools to generate tags in
  the form of Zope Pagetemplates, Genshi and other template languages that
  are much better suited for this purpose.

In addition several implementation goals were defined:

- image scaling must happen on demand instead of up-front. This reduces
  initial save time and prevents unnecessary scalings from being generated.

- image scaling parameters should not be part of the generated URL. Since
  the number of parameters can change and new parameters may be added in
  the future this would create overly complex URLs and URL parsing.

- no HTML rewriting (such as done by `repoze.bitblt`_) should be required.

- it should be possibly to develop an external storage system which stores
  scaled images externally and returns a URL which bypasses the application
  server. This should be configurable via just a filesystem path & base
  URL.

- minimum number of external dependencies, allowing this package to be
  used in many environments.

- testable without requiring zope.testing. Running `setup.py test` should
  be sufficient.

- URLs for scaled images should have an extension which reflects their
  MIME type. This is facilitates cache (and other front-end services)
  configuration.

.. _repoze.bitblt: http://pypi.python.org/pypi/repoze.bitblt


Usage
=====

The most common way to use *plone.scale* is from a HTML template.
In TAL syntax a typical usage looks like this, assuming you have hooked up an ``image-scaling`` view::

  <img tal:define="scales context/@@image-scaling;
                   thumbnail python:scales.pre_scale('logo', width=64, height=64)"
       tal:attributes="src thumbnail/url;
                       width thumbnail/width;
                       height thumbnail/height" />

With the ``pre_scale`` method, no scaling with Pillow actually happens yet.
If you call the ``scale`` method instead, the scaling does happen.
This generates a thumbnail of an image field called *logo* with a maximum size
of 64x64 pixels. The dimensions of the resulting image (which might not be
exactly 64x64) are set as attributes on the ``img`` tag to speed up browser
rendering.
Visiting the url will generate the scale if this has not happened yet.

If you prefer Genshi syntax and have the ``IImageScaleStorage`` interface
in scope the syntax looks like this::

  <img py:with="thumbnail=IImageScaleStorage(context).pre_scale('logo', width=64, height=64)"
       py:attributes="dict(src=thumbnail.url, width=thumbnail.width, height=thumbnail.height" />

Changelog
=========

.. You should *NOT* be adding new change log entries to this file.
   You should create a file in the news directory instead.
   For helpful instructions, please see:
   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst

.. towncrier release notes start

4.1.0 (2023-10-25)
------------------

New features:


- Keep scaled WEBP images in WEBP format instead of converting to JPEG. @mamico (#85)


4.0.2 (2023-10-07)
------------------

Bug fixes:


- Fix KeyError in ScalesDict conflict resolution. @davisagli (#84)


Internal:


- Update configuration files.
  [plone devs] (cfffba8c)


4.0.1 (2023-03-14)
------------------

Internal:


- Update configuration files.
  [plone devs] (a533099d)


Tests


- Tox: explicitly test only the ``plone.scale`` package.  [maurits] (#50)


4.0.0 (2022-11-26)
------------------

Bug fixes:


- Test with Python 3.11.  [maurits] (#311)
- Require Python 3.7 or higher.  [maurits] (#600)


4.0.0b5 (2022-10-20)
--------------------

New features:


- Add support for animated GIFs @reebalazs (#69)


4.0.0b4 (2022-10-03)
--------------------

Breaking changes:


- No longer test Plone 5.2 on 3.6 and Plone 6.0 on 3.7.
  [maurits] (#3637)


Bug fixes:


- Use "scale" mode as default.
  This cleans up more confusion between mode and direction.
  See also `plone.namedfile issue 102 <https://github.com/plone/plone.namedfile/issues/102>`_.
  Previously our definition of the ``IImageScaleFactory`` interface had the deprecated ``direction="thumbnail"``.
  Other parts used ``mode="contain"`` by default, which does cropping, where in Plone we are used to simple scaling almost everywhere.
  [maurits] (#102)


4.0.0b3 (2022-07-19)
--------------------

Bug fixes:


- Fixed getting original data for a tile.
  [maurits] (#64)


4.0.0b2 (2022-07-14)
--------------------

Bug fixes:


- Fix to ensure that when a scale that was registered using `pre_scale` is
  later actually generated by `get_or_generate`, it is stored with the same
  uid as the placeholder info that was stored by `pre_scale`. This avoids
  an issue where the same scale was generated repeatedly.
  [davisagli] (#60)


4.0.0b1 (2022-06-23)
--------------------

New features:


- Pre scale: store non-random uid to prepare space for a scale.
  You call ``pre_scale`` to pre-register the scale with a unique id
  without actually doing any scaling with Pillow.
  When you later call the ``scale`` method, the scale is generated.
  You can still call ``scale`` directly without first calling ``pre_scale``.
  [maurits] (#57)
- Mark as plone.protect's safeWrite AnnotationStorage.
  Precondition for https://github.com/plone/plone.namedfile/pull/117.
  [mamico] (#58)


Bug fixes:


- Minor cleanup: isort, black.  [maurits] (#59)


4.0.0a4 (2022-05-26)
--------------------

Bug fixes:


- Fix cropping when the height is not limited.
  Create a square then.
  Not limited means: 65000 or larger, or zero or lower.
  [maurits] (#53)
- Fix cleanup of scales: only throw away outdated scales of the same field.
  [maurits] (#55)


4.0.0a3 (2022-05-09)
--------------------

Bug fixes:


- Fixed ``DeprecationWarning`` with Pillow 9.1.0 for ``ANTIALIAS``.
  Use ``Resampling.LANCZOS``, falling back to ``ANTIALIAS`` on older Pillows.
  [maurits] (#49)


4.0.0a2 (2022-03-09)
--------------------

Breaking changes:


- Removed deprecated ``factory`` argument from ``scale`` method.
  This is in the ``AnnotationStorage`` class and the ``IImageScaleStorage`` interface.
  This was already scheduled for removal in ``plone.scale`` 3.0, but was kept longer.
  Fixes `issue 47 <https://github.com/plone/plone.scale/issues/47>`_.
  [maurits] (#47)


4.0.0a1 (2022-02-23)
--------------------

Breaking changes:


- Removed docs directory and sphinx extra.
  The docs were last updated in 2010, and the maybe still relevant parts already copied to the readme.
  [maurits] (#44)
- Removed ``tests`` extra, kept only ``test`` extra and ``storage``.
  Swapped packages slightly between those two extras.
  For ``storage`` we depend on ``persistent`` and ``ZODB``.
  [maurits] (#44)
- Depend on Pillow.
  Originally we did not officially depend on it (or PIL) "because not everyone can install it as an egg".
  It seems time to grow up here.
  [maurits] (#44)
- Removed Python 2 support.  Only Python 3.6+ supported now.
  Still works on Plone 5.2.
  [maurits] (#44)


New features:


- Add tox.ini with mxdev.
  Test with GitHub Actions on Plone 5.2 Py + 3.6-3.8 and Plone 6.0 + Py 3.7-3.10.
  [maurits] (#44)


3.1.2 (2020-09-07)
------------------

Bug fixes:


- Resolve deprecation warning [gforcada] (#42)


3.1.1 (2020-04-22)
------------------

Bug fixes:


- Minor packaging updates. (#1)


3.1.0 (2020-03-08)
------------------

New features:


- The ``mode`` argument replaces the old, now deprecated, ``direction`` argument.
  The new names are ``contain`` or ``scale-crop-to-fit`` instead of ``down``,
  ``cover`` or ``scale-crop-to-fill`` instead of ``up``
  and ``scale`` instead of ``thumbnail``.
  [fschulze] (#29)
- Added ``calculate_scaled_dimensions`` function to calculate sizes from bare values without actually scaling an image.
  [fschulze]

  Added ``MAX_PIXELS`` constant set to ``8192*8192`` to prevent memory overflow while scaling.
  [fschulze] (#37)


Bug fixes:


- Fix documentation of scaling modes to match it's behavior.
  [thet] (#39)


3.0.3 (2018-11-04)
------------------

Bug fixes:

- reduce warnings in tests [jensens]


3.0.2 (2018-09-28)
------------------

Bug fixes:

- Fix cleanup of image scales in py3
  [pbauer]


3.0.1 (2018-04-03)
------------------

Bug fixes:

- Fix conflict resolution code corner case.
  [gforcada]


3.0 (2017-10-02)
----------------

Breaking changes:

- Restore scale down behaviour from 1.x series without the huge memory usage.
  [fschulze]

New features:

- Handle TIFF images with alpha channels.
  [fschulze]


2.2 (2017-08-27)
----------------

New features:

- Python 3 compatibility.
  [dhavlik]


2.1.2 (2017-05-31)
------------------

Bug fixes:

- Remove unused dependency.
  [gforcada]


2.1.1 (2017-03-29)
------------------

Bug fixes:

- Only convert JPEG to greyscale if they actually are and not when the image
  has less than 256 colors. This bug was introduced in 2.1 with PR #13.
  [fschulze]

- Preserve color profile in scaled images.
  [fschulze]


2.1 (2016-11-01)
----------------

New features:

- Choose an appropriate image mode in order to reduce file size.
  [didrix]

Bug fixes:

- Require the ``six`` package so we can more easily check number types.
  On Python 3 ``long`` has been merged into ``int``.  [maurits]

- When getting an outdated scale, don't throw it away when there is no
  factory.  [maurits]

- Avoid TypeErrors when looking for outdated scales.
  Fixes `issue 12 <https://github.com/plone/plone.scale/issues/12>`_.
  [maurits]

- Catch KeyError when deleting non existing scale.  This can happen in corner cases.
  Fixes `issue 15 <https://github.com/plone/plone.scale/issues/15>`_.
  [maurits]

- Set ``zip_safe=False`` in ``setup.py``.  Otherwise you cannot run
  the tests of the released package because the test runner does not
  find any tests in the egg file.  Note that this is only a problem in
  zc.buildout 1.x: it uses unzip=False by default.  zc.buildout 2.x no
  longer has this option and always unzips eggs.  [maurits]


2.0 (2016-08-12)
----------------

New:

- Assume a width or height of zero is semantically the same as None already was:
  Use the other dimension to scale, calculate the missing one.
  [jensens, thet]

- Scaled GIFs are converted to RGBA PNG images instead of converting them to JPEG.
  [thet, jensens]

Fixes:

- Don't scale images up for direction "down".
  [thet]

- Major housekeeping, code refactored in order to reduce complexicty.
  [jensens]


1.5.0 (2016-05-18)
------------------

New:

- Use an adapter to lookup the actual factory for scaling.
  Deprecated passing the factory as named parameter along,
  because this had not enough flexibility:
  If addons want to provide alternative methods to scale (i.e. cropping),
  now a specific adapter can perform the work.
  [jensens]

Fixes:

- Minor housekeeping.
  [jensens]


1.4.1 (2016-02-12)
------------------

Fixes:

- Fix KeyError in storage.AnnotationStorage._cleanup when attempting
  to delete the storage for the same key twice.
  [fulv]


1.4 (2015-12-07)
----------------

New:

- Resolve conflicts raised when accessing multiple scales concurrently.
  [gotcha]

- Refactored scale storage.
  [gotcha]


1.3.5 (2015-03-10)
------------------

- PIL thumbnail does not work for magnifying images (when scaling up).
  Use resize instead. [sureshvv]


1.3.4 (2014-09-07)
------------------

- When a scale is outdated, discard all image scales that are more
  than a day older than the context.
  Refs https://dev.plone.org/ticket/13791
  [maurits]

- Make sure deleting items or clearing a complete storage works.
  Deleting one item would often delete a linked second item, which
  made it hard to remove several items at once.
  [maurits]


1.3.3 (2014-01-27)
------------------

- Discard old image scales if item was modified.
  Refs https://dev.plone.org/ticket/13791
  [gforcada]

- Generate Progressive JPEG.
  [kroman0]


1.3.2 (2013-05-23)
------------------

- Added a marker interface for scaled image quality.
  Refs http://dev.plone.org/plone/ticket/13337
  [khink]


1.3.1 (2013-04-06)
------------------

- Cropped images are now centralised vertically as well as horizontally [mattss]


1.3 (2013-01-17)
----------------

- Add MANIFEST.in.
  [WouterVH]

- Break up `scaleImage`, so that its scaling-related parts can be applied
  to instances of `PIL.Image` for further processing.
  [witsch]


1.2.2 - 2010-09-28
------------------

- Re-release to fix bad egg created for 1.2.1.
  Refs http://dev.plone.org/plone/ticket/11154
  [witsch]


1.2.1 - 2010-08-18
------------------

- Convert CMYK to RGB, allowing for web previews of print images.
  [tomster]


1.2 - 2010-07-18
----------------

- Update package metadata.
  [hannosch]


1.1 - 2010-04-20
----------------

- Abort if thumbnail behaviour is requested but either width or height is
  missing. This is nicer than confronting the caller with a PIL exception.
  [wichert]

- Rename the `keep` direction to `thumbnail` to make its behaviour more
  intuitive, but accept `keep` for now.
  [wichert]


1.0 - 2010-04-12
----------------

- Only pull in the uuid distribution in Python versions before 2.5.
  [hannosch]

- Don't declare dependency on PIL.
  [davisagli]


1.0a2 - 2010-04-10
------------------

- Add BSD license text following board decision:
  http://lists.plone.org/pipermail/membership/2009-August/001038.html
  [elro]

- Allow to use PIL's thumbnail algorithm to keep the present aspect ratio.
  [spamsch, witsch]

- Allow to set the quality of the resulting image scales.
  [witsch]

- Refactor storage adapter for image scales to be less dependent on the
  underlying content type.
  [witsch]


1.0a1 - 2009-11-10
------------------

- Initial release
  [wichert]

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/plone.scale",
    "name": "plone.scale",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/plone.scale/",
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "image scaling",
    "author": "Plone Foundation",
    "author_email": "plone-developers@lists.sourceforge.net",
    "download_url": "https://files.pythonhosted.org/packages/a8/8e/79014fd777e2c30d1faea750e680732eec6fb85e986310ec3a922a20355d/plone.scale-4.1.0.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\nThis package contains image scaling logic for use in Zope environments. It\nsupports Zope 2, grok and other systems build on using the Zope ToolKit (ZTK).\n\nSeveral design goals were used when writing this package:\n\n- image scaling to any width, height, width&height should be supported\n  using both up-scaling and down-scaling. Scaling parameters should never\n  be fixed in code. This allows designers to use any image scale they want\n  without having to modify python code.\n\n- the result of scaling will be an image along with its new size, not a\n  HTML or XHTML tag. We already have excellent tools to generate tags in\n  the form of Zope Pagetemplates, Genshi and other template languages that\n  are much better suited for this purpose.\n\nIn addition several implementation goals were defined:\n\n- image scaling must happen on demand instead of up-front. This reduces\n  initial save time and prevents unnecessary scalings from being generated.\n\n- image scaling parameters should not be part of the generated URL. Since\n  the number of parameters can change and new parameters may be added in\n  the future this would create overly complex URLs and URL parsing.\n\n- no HTML rewriting (such as done by `repoze.bitblt`_) should be required.\n\n- it should be possibly to develop an external storage system which stores\n  scaled images externally and returns a URL which bypasses the application\n  server. This should be configurable via just a filesystem path & base\n  URL.\n\n- minimum number of external dependencies, allowing this package to be\n  used in many environments.\n\n- testable without requiring zope.testing. Running `setup.py test` should\n  be sufficient.\n\n- URLs for scaled images should have an extension which reflects their\n  MIME type. This is facilitates cache (and other front-end services)\n  configuration.\n\n.. _repoze.bitblt: http://pypi.python.org/pypi/repoze.bitblt\n\n\nUsage\n=====\n\nThe most common way to use *plone.scale* is from a HTML template.\nIn TAL syntax a typical usage looks like this, assuming you have hooked up an ``image-scaling`` view::\n\n  <img tal:define=\"scales context/@@image-scaling;\n                   thumbnail python:scales.pre_scale('logo', width=64, height=64)\"\n       tal:attributes=\"src thumbnail/url;\n                       width thumbnail/width;\n                       height thumbnail/height\" />\n\nWith the ``pre_scale`` method, no scaling with Pillow actually happens yet.\nIf you call the ``scale`` method instead, the scaling does happen.\nThis generates a thumbnail of an image field called *logo* with a maximum size\nof 64x64 pixels. The dimensions of the resulting image (which might not be\nexactly 64x64) are set as attributes on the ``img`` tag to speed up browser\nrendering.\nVisiting the url will generate the scale if this has not happened yet.\n\nIf you prefer Genshi syntax and have the ``IImageScaleStorage`` interface\nin scope the syntax looks like this::\n\n  <img py:with=\"thumbnail=IImageScaleStorage(context).pre_scale('logo', width=64, height=64)\"\n       py:attributes=\"dict(src=thumbnail.url, width=thumbnail.width, height=thumbnail.height\" />\n\nChangelog\n=========\n\n.. You should *NOT* be adding new change log entries to this file.\n   You should create a file in the news directory instead.\n   For helpful instructions, please see:\n   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst\n\n.. towncrier release notes start\n\n4.1.0 (2023-10-25)\n------------------\n\nNew features:\n\n\n- Keep scaled WEBP images in WEBP format instead of converting to JPEG. @mamico (#85)\n\n\n4.0.2 (2023-10-07)\n------------------\n\nBug fixes:\n\n\n- Fix KeyError in ScalesDict conflict resolution. @davisagli (#84)\n\n\nInternal:\n\n\n- Update configuration files.\n  [plone devs] (cfffba8c)\n\n\n4.0.1 (2023-03-14)\n------------------\n\nInternal:\n\n\n- Update configuration files.\n  [plone devs] (a533099d)\n\n\nTests\n\n\n- Tox: explicitly test only the ``plone.scale`` package.  [maurits] (#50)\n\n\n4.0.0 (2022-11-26)\n------------------\n\nBug fixes:\n\n\n- Test with Python 3.11.  [maurits] (#311)\n- Require Python 3.7 or higher.  [maurits] (#600)\n\n\n4.0.0b5 (2022-10-20)\n--------------------\n\nNew features:\n\n\n- Add support for animated GIFs @reebalazs (#69)\n\n\n4.0.0b4 (2022-10-03)\n--------------------\n\nBreaking changes:\n\n\n- No longer test Plone 5.2 on 3.6 and Plone 6.0 on 3.7.\n  [maurits] (#3637)\n\n\nBug fixes:\n\n\n- Use \"scale\" mode as default.\n  This cleans up more confusion between mode and direction.\n  See also `plone.namedfile issue 102 <https://github.com/plone/plone.namedfile/issues/102>`_.\n  Previously our definition of the ``IImageScaleFactory`` interface had the deprecated ``direction=\"thumbnail\"``.\n  Other parts used ``mode=\"contain\"`` by default, which does cropping, where in Plone we are used to simple scaling almost everywhere.\n  [maurits] (#102)\n\n\n4.0.0b3 (2022-07-19)\n--------------------\n\nBug fixes:\n\n\n- Fixed getting original data for a tile.\n  [maurits] (#64)\n\n\n4.0.0b2 (2022-07-14)\n--------------------\n\nBug fixes:\n\n\n- Fix to ensure that when a scale that was registered using `pre_scale` is\n  later actually generated by `get_or_generate`, it is stored with the same\n  uid as the placeholder info that was stored by `pre_scale`. This avoids\n  an issue where the same scale was generated repeatedly.\n  [davisagli] (#60)\n\n\n4.0.0b1 (2022-06-23)\n--------------------\n\nNew features:\n\n\n- Pre scale: store non-random uid to prepare space for a scale.\n  You call ``pre_scale`` to pre-register the scale with a unique id\n  without actually doing any scaling with Pillow.\n  When you later call the ``scale`` method, the scale is generated.\n  You can still call ``scale`` directly without first calling ``pre_scale``.\n  [maurits] (#57)\n- Mark as plone.protect's safeWrite AnnotationStorage.\n  Precondition for https://github.com/plone/plone.namedfile/pull/117.\n  [mamico] (#58)\n\n\nBug fixes:\n\n\n- Minor cleanup: isort, black.  [maurits] (#59)\n\n\n4.0.0a4 (2022-05-26)\n--------------------\n\nBug fixes:\n\n\n- Fix cropping when the height is not limited.\n  Create a square then.\n  Not limited means: 65000 or larger, or zero or lower.\n  [maurits] (#53)\n- Fix cleanup of scales: only throw away outdated scales of the same field.\n  [maurits] (#55)\n\n\n4.0.0a3 (2022-05-09)\n--------------------\n\nBug fixes:\n\n\n- Fixed ``DeprecationWarning`` with Pillow 9.1.0 for ``ANTIALIAS``.\n  Use ``Resampling.LANCZOS``, falling back to ``ANTIALIAS`` on older Pillows.\n  [maurits] (#49)\n\n\n4.0.0a2 (2022-03-09)\n--------------------\n\nBreaking changes:\n\n\n- Removed deprecated ``factory`` argument from ``scale`` method.\n  This is in the ``AnnotationStorage`` class and the ``IImageScaleStorage`` interface.\n  This was already scheduled for removal in ``plone.scale`` 3.0, but was kept longer.\n  Fixes `issue 47 <https://github.com/plone/plone.scale/issues/47>`_.\n  [maurits] (#47)\n\n\n4.0.0a1 (2022-02-23)\n--------------------\n\nBreaking changes:\n\n\n- Removed docs directory and sphinx extra.\n  The docs were last updated in 2010, and the maybe still relevant parts already copied to the readme.\n  [maurits] (#44)\n- Removed ``tests`` extra, kept only ``test`` extra and ``storage``.\n  Swapped packages slightly between those two extras.\n  For ``storage`` we depend on ``persistent`` and ``ZODB``.\n  [maurits] (#44)\n- Depend on Pillow.\n  Originally we did not officially depend on it (or PIL) \"because not everyone can install it as an egg\".\n  It seems time to grow up here.\n  [maurits] (#44)\n- Removed Python 2 support.  Only Python 3.6+ supported now.\n  Still works on Plone 5.2.\n  [maurits] (#44)\n\n\nNew features:\n\n\n- Add tox.ini with mxdev.\n  Test with GitHub Actions on Plone 5.2 Py + 3.6-3.8 and Plone 6.0 + Py 3.7-3.10.\n  [maurits] (#44)\n\n\n3.1.2 (2020-09-07)\n------------------\n\nBug fixes:\n\n\n- Resolve deprecation warning [gforcada] (#42)\n\n\n3.1.1 (2020-04-22)\n------------------\n\nBug fixes:\n\n\n- Minor packaging updates. (#1)\n\n\n3.1.0 (2020-03-08)\n------------------\n\nNew features:\n\n\n- The ``mode`` argument replaces the old, now deprecated, ``direction`` argument.\n  The new names are ``contain`` or ``scale-crop-to-fit`` instead of ``down``,\n  ``cover`` or ``scale-crop-to-fill`` instead of ``up``\n  and ``scale`` instead of ``thumbnail``.\n  [fschulze] (#29)\n- Added ``calculate_scaled_dimensions`` function to calculate sizes from bare values without actually scaling an image.\n  [fschulze]\n\n  Added ``MAX_PIXELS`` constant set to ``8192*8192`` to prevent memory overflow while scaling.\n  [fschulze] (#37)\n\n\nBug fixes:\n\n\n- Fix documentation of scaling modes to match it's behavior.\n  [thet] (#39)\n\n\n3.0.3 (2018-11-04)\n------------------\n\nBug fixes:\n\n- reduce warnings in tests [jensens]\n\n\n3.0.2 (2018-09-28)\n------------------\n\nBug fixes:\n\n- Fix cleanup of image scales in py3\n  [pbauer]\n\n\n3.0.1 (2018-04-03)\n------------------\n\nBug fixes:\n\n- Fix conflict resolution code corner case.\n  [gforcada]\n\n\n3.0 (2017-10-02)\n----------------\n\nBreaking changes:\n\n- Restore scale down behaviour from 1.x series without the huge memory usage.\n  [fschulze]\n\nNew features:\n\n- Handle TIFF images with alpha channels.\n  [fschulze]\n\n\n2.2 (2017-08-27)\n----------------\n\nNew features:\n\n- Python 3 compatibility.\n  [dhavlik]\n\n\n2.1.2 (2017-05-31)\n------------------\n\nBug fixes:\n\n- Remove unused dependency.\n  [gforcada]\n\n\n2.1.1 (2017-03-29)\n------------------\n\nBug fixes:\n\n- Only convert JPEG to greyscale if they actually are and not when the image\n  has less than 256 colors. This bug was introduced in 2.1 with PR #13.\n  [fschulze]\n\n- Preserve color profile in scaled images.\n  [fschulze]\n\n\n2.1 (2016-11-01)\n----------------\n\nNew features:\n\n- Choose an appropriate image mode in order to reduce file size.\n  [didrix]\n\nBug fixes:\n\n- Require the ``six`` package so we can more easily check number types.\n  On Python 3 ``long`` has been merged into ``int``.  [maurits]\n\n- When getting an outdated scale, don't throw it away when there is no\n  factory.  [maurits]\n\n- Avoid TypeErrors when looking for outdated scales.\n  Fixes `issue 12 <https://github.com/plone/plone.scale/issues/12>`_.\n  [maurits]\n\n- Catch KeyError when deleting non existing scale.  This can happen in corner cases.\n  Fixes `issue 15 <https://github.com/plone/plone.scale/issues/15>`_.\n  [maurits]\n\n- Set ``zip_safe=False`` in ``setup.py``.  Otherwise you cannot run\n  the tests of the released package because the test runner does not\n  find any tests in the egg file.  Note that this is only a problem in\n  zc.buildout 1.x: it uses unzip=False by default.  zc.buildout 2.x no\n  longer has this option and always unzips eggs.  [maurits]\n\n\n2.0 (2016-08-12)\n----------------\n\nNew:\n\n- Assume a width or height of zero is semantically the same as None already was:\n  Use the other dimension to scale, calculate the missing one.\n  [jensens, thet]\n\n- Scaled GIFs are converted to RGBA PNG images instead of converting them to JPEG.\n  [thet, jensens]\n\nFixes:\n\n- Don't scale images up for direction \"down\".\n  [thet]\n\n- Major housekeeping, code refactored in order to reduce complexicty.\n  [jensens]\n\n\n1.5.0 (2016-05-18)\n------------------\n\nNew:\n\n- Use an adapter to lookup the actual factory for scaling.\n  Deprecated passing the factory as named parameter along,\n  because this had not enough flexibility:\n  If addons want to provide alternative methods to scale (i.e. cropping),\n  now a specific adapter can perform the work.\n  [jensens]\n\nFixes:\n\n- Minor housekeeping.\n  [jensens]\n\n\n1.4.1 (2016-02-12)\n------------------\n\nFixes:\n\n- Fix KeyError in storage.AnnotationStorage._cleanup when attempting\n  to delete the storage for the same key twice.\n  [fulv]\n\n\n1.4 (2015-12-07)\n----------------\n\nNew:\n\n- Resolve conflicts raised when accessing multiple scales concurrently.\n  [gotcha]\n\n- Refactored scale storage.\n  [gotcha]\n\n\n1.3.5 (2015-03-10)\n------------------\n\n- PIL thumbnail does not work for magnifying images (when scaling up).\n  Use resize instead. [sureshvv]\n\n\n1.3.4 (2014-09-07)\n------------------\n\n- When a scale is outdated, discard all image scales that are more\n  than a day older than the context.\n  Refs https://dev.plone.org/ticket/13791\n  [maurits]\n\n- Make sure deleting items or clearing a complete storage works.\n  Deleting one item would often delete a linked second item, which\n  made it hard to remove several items at once.\n  [maurits]\n\n\n1.3.3 (2014-01-27)\n------------------\n\n- Discard old image scales if item was modified.\n  Refs https://dev.plone.org/ticket/13791\n  [gforcada]\n\n- Generate Progressive JPEG.\n  [kroman0]\n\n\n1.3.2 (2013-05-23)\n------------------\n\n- Added a marker interface for scaled image quality.\n  Refs http://dev.plone.org/plone/ticket/13337\n  [khink]\n\n\n1.3.1 (2013-04-06)\n------------------\n\n- Cropped images are now centralised vertically as well as horizontally [mattss]\n\n\n1.3 (2013-01-17)\n----------------\n\n- Add MANIFEST.in.\n  [WouterVH]\n\n- Break up `scaleImage`, so that its scaling-related parts can be applied\n  to instances of `PIL.Image` for further processing.\n  [witsch]\n\n\n1.2.2 - 2010-09-28\n------------------\n\n- Re-release to fix bad egg created for 1.2.1.\n  Refs http://dev.plone.org/plone/ticket/11154\n  [witsch]\n\n\n1.2.1 - 2010-08-18\n------------------\n\n- Convert CMYK to RGB, allowing for web previews of print images.\n  [tomster]\n\n\n1.2 - 2010-07-18\n----------------\n\n- Update package metadata.\n  [hannosch]\n\n\n1.1 - 2010-04-20\n----------------\n\n- Abort if thumbnail behaviour is requested but either width or height is\n  missing. This is nicer than confronting the caller with a PIL exception.\n  [wichert]\n\n- Rename the `keep` direction to `thumbnail` to make its behaviour more\n  intuitive, but accept `keep` for now.\n  [wichert]\n\n\n1.0 - 2010-04-12\n----------------\n\n- Only pull in the uuid distribution in Python versions before 2.5.\n  [hannosch]\n\n- Don't declare dependency on PIL.\n  [davisagli]\n\n\n1.0a2 - 2010-04-10\n------------------\n\n- Add BSD license text following board decision:\n  http://lists.plone.org/pipermail/membership/2009-August/001038.html\n  [elro]\n\n- Allow to use PIL's thumbnail algorithm to keep the present aspect ratio.\n  [spamsch, witsch]\n\n- Allow to set the quality of the resulting image scales.\n  [witsch]\n\n- Refactor storage adapter for image scales to be less dependent on the\n  underlying content type.\n  [witsch]\n\n\n1.0a1 - 2009-11-10\n------------------\n\n- Initial release\n  [wichert]\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Image scaling",
    "version": "4.1.0",
    "project_urls": {
        "Homepage": "https://pypi.org/project/plone.scale"
    },
    "split_keywords": [
        "image",
        "scaling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7172777cec49654ffe3b2d56e38a425549115baaa562534cf5612a22563edbbc",
                "md5": "a6b722fbf2a9fc58c62ecb062596c662",
                "sha256": "bc7d41f79867dc2ef0aa033bcd0cf41bfaec89b608036407ee96c6d8fee3a59f"
            },
            "downloads": -1,
            "filename": "plone.scale-4.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a6b722fbf2a9fc58c62ecb062596c662",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2181058,
            "upload_time": "2023-10-25T10:19:40",
            "upload_time_iso_8601": "2023-10-25T10:19:40.461309Z",
            "url": "https://files.pythonhosted.org/packages/71/72/777cec49654ffe3b2d56e38a425549115baaa562534cf5612a22563edbbc/plone.scale-4.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a88e79014fd777e2c30d1faea750e680732eec6fb85e986310ec3a922a20355d",
                "md5": "c38157a00f601952fdc7c72620ea0c31",
                "sha256": "f00400d2fd03610e4015188baae70b031c8bea44b375df8090f02e35f3e2505f"
            },
            "downloads": -1,
            "filename": "plone.scale-4.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c38157a00f601952fdc7c72620ea0c31",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 2186346,
            "upload_time": "2023-10-25T10:19:45",
            "upload_time_iso_8601": "2023-10-25T10:19:45.513162Z",
            "url": "https://files.pythonhosted.org/packages/a8/8e/79014fd777e2c30d1faea750e680732eec6fb85e986310ec3a922a20355d/plone.scale-4.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-25 10:19:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "plone.scale"
}
        
Elapsed time: 0.13265s