Python Imaging Library (Fork)
Go to file
Quentin Schulz 9bbba06129 src: PIL: JpegImagePlugin.py: make -1 and keep subsamplings identical for save
Make the -1 subsampling behave like "keep" for the save method.

The doc claims that -1 is equivalent to keep. It is actually equivalent
to 4:2:0 for some reason.

Note that -1 was representing both the -1 subsampling and the absence of
it. To persist the current behavior which is compatible with multiple
input file formats other than JPEG (which is not the case of the
subsampling parameter), make the absence of subsampling parameter equal
to -2.

get_sampling() remains unchanged since it is a public API.
Note that subsampling can be -1 and -2 in some cases, both results in an
image with a subsampling of 4:2:0.

Also removing faulty test case since subsampling -1 cannot be used on a
generated image but only JPEG file format.

Signed-off-by: Quentin Schulz <foss@0leil.net>
2020-04-20 21:51:30 +02:00
.ci Retry on apt-get update problems 2020-04-06 22:23:41 +10:00
.github Removed success conditions 2020-04-10 14:18:42 +10:00
depends Updated libwebp to 1.1.0 2020-01-07 19:21:26 +11:00
docs src: PIL: JpegImagePlugin.py: make -1 and keep subsamplings identical for save 2020-04-20 21:51:30 +02:00
src src: PIL: JpegImagePlugin.py: make -1 and keep subsamplings identical for save 2020-04-20 21:51:30 +02:00
Tests src: PIL: JpegImagePlugin.py: make -1 and keep subsamplings identical for save 2020-04-20 21:51:30 +02:00
winbuild Updated PyPy to 7.3.1 2020-04-11 10:50:33 +10:00
.appveyor.yml Updated PyPy to 7.3.1 2020-04-11 10:50:33 +10:00
.coveragerc Removed unnecessary line 2020-01-03 16:40:31 +11:00
.editorconfig Remove duplicate line [CI skip] 2016-09-03 12:37:47 +03:00
.gitattributes Set EPS test files as binary 2018-12-29 21:53:07 -08:00
.gitignore Add documentation to Image module 2019-04-06 13:42:22 -07:00
.pre-commit-config.yaml Run lint with pre-commit 2020-03-22 10:36:55 +02:00
.readthedocs.yml Install project using pip in ReadTheDocs build 2018-10-24 19:46:43 +11:00
.travis.yml Run lint with pre-commit 2020-03-22 10:36:55 +02:00
CHANGES.rst Updated CHANGES.rst [ci skip] 2020-04-18 08:50:52 +10:00
codecov.yml Allow 0.01% drop in coverage 2020-03-29 12:34:00 +11:00
conftest.py Declare helper as a pytest plugin so asserts aren't ignored with PYTHONOPTIMIZE 2020-02-02 12:26:01 +02:00
LICENSE Word wrap LICENSE file 2020-01-06 07:39:43 -05:00
Makefile Ensure Python 3's pip to install requirements 2020-04-07 07:31:15 +10:00
MANIFEST.in GitHub Actions now sets CI=true 2020-04-16 20:42:29 +03:00
README.rst Update Tidelift UTM params [ci skip] 2020-03-31 10:25:01 -07:00
RELEASING.md Also push commits 2020-04-07 07:31:15 +10:00
requirements.txt Removed coveralls 2020-01-18 18:49:37 +11:00
selftest.py Since Python 3.3 IOError and WindowsError have been merged into OSError 2020-04-10 12:57:29 +03:00
setup.cfg Remove deprecated pytest-runner support 2020-01-27 08:23:34 -08:00
setup.py Since Python 3.3 IOError and WindowsError have been merged into OSError 2020-04-10 12:57:29 +03:00
tox.ini Run lint with pre-commit 2020-03-22 10:36:55 +02:00

Pillow
======

Python Imaging Library (Fork)
-----------------------------

Pillow is the friendly PIL fork by `Alex Clark and Contributors <https://github.com/python-pillow/Pillow/graphs/contributors>`_. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. As of 2019, Pillow development is `supported by Tidelift <https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=readme&utm_campaign=enterprise>`_.

.. start-badges

.. list-table::
    :stub-columns: 1

    * - docs
      - |docs|
    * - tests
      - |linux| |macos| |windows| |gha_lint| |gha| |gha_windows| |gha_docker| |coverage|
    * - package
      - |zenodo| |tidelift| |version| |downloads|
    * - social
      - |gitter| |twitter|

.. end-badges

More Information
----------------

- `Documentation <https://pillow.readthedocs.io/>`_

  - `Installation <https://pillow.readthedocs.io/en/latest/installation.html>`_
  - `Handbook <https://pillow.readthedocs.io/en/latest/handbook/index.html>`_

- `Contribute <https://github.com/python-pillow/Pillow/blob/master/.github/CONTRIBUTING.md>`_

  - `Issues <https://github.com/python-pillow/Pillow/issues>`_
  - `Pull requests <https://github.com/python-pillow/Pillow/pulls>`_

- `Changelog <https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst>`_

  - `Pre-fork <https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst#pre-fork>`_

Report a Vulnerability
----------------------

To report a security vulnerability, please follow the procedure described in the `Tidelift security policy <https://tidelift.com/docs/security>`_.

.. |docs| image:: https://readthedocs.org/projects/pillow/badge/?version=latest
   :target: https://pillow.readthedocs.io/?badge=latest
   :alt: Documentation Status

.. |linux| image:: https://img.shields.io/travis/python-pillow/Pillow/master.svg?label=Linux%20build
   :target: https://travis-ci.org/python-pillow/Pillow
   :alt: Travis CI build status (Linux)

.. |macos| image:: https://img.shields.io/travis/python-pillow/pillow-wheels/master.svg?label=macOS%20build
   :target: https://travis-ci.org/python-pillow/pillow-wheels
   :alt: Travis CI build status (macOS)

.. |windows| image:: https://img.shields.io/appveyor/build/python-pillow/Pillow/master.svg?label=Windows%20build
   :target: https://ci.appveyor.com/project/python-pillow/Pillow
   :alt: AppVeyor CI build status (Windows)

.. |gha_lint| image:: https://github.com/python-pillow/Pillow/workflows/Lint/badge.svg
   :target: https://github.com/python-pillow/Pillow/actions?query=workflow%3ALint
   :alt: GitHub Actions build status (Lint)

.. |gha_docker| image:: https://github.com/python-pillow/Pillow/workflows/Test%20Docker/badge.svg
   :target: https://github.com/python-pillow/Pillow/actions?query=workflow%3A%22Test+Docker%22
   :alt: GitHub Actions build status (Test Docker)

.. |gha| image:: https://github.com/python-pillow/Pillow/workflows/Test/badge.svg
   :target: https://github.com/python-pillow/Pillow/actions?query=workflow%3ATest
   :alt: GitHub Actions build status (Test Linux and macOS)

.. |gha_windows| image:: https://github.com/python-pillow/Pillow/workflows/Test%20Windows/badge.svg
   :target: https://github.com/python-pillow/Pillow/actions?query=workflow%3A%22Test+Windows%22
   :alt: GitHub Actions build status (Test Windows)

.. |coverage| image:: https://codecov.io/gh/python-pillow/Pillow/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/python-pillow/Pillow
   :alt: Code coverage

.. |zenodo| image:: https://zenodo.org/badge/17549/python-pillow/Pillow.svg
   :target: https://zenodo.org/badge/latestdoi/17549/python-pillow/Pillow

.. |tidelift| image:: https://tidelift.com/badges/package/pypi/Pillow?style=flat
   :target: https://tidelift.com/subscription/pkg/pypi-pillow?utm_source=pypi-pillow&utm_medium=badge

.. |version| image:: https://img.shields.io/pypi/v/pillow.svg
   :target: https://pypi.org/project/Pillow/
   :alt: Latest PyPI version

.. |downloads| image:: https://img.shields.io/pypi/dm/pillow.svg
   :target: https://pypi.org/project/Pillow/
   :alt: Number of PyPI downloads

.. |gitter| image:: https://badges.gitter.im/python-pillow/Pillow.svg
   :target: https://gitter.im/python-pillow/Pillow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
   :alt: Join the chat at https://gitter.im/python-pillow/Pillow

.. |twitter| image:: https://img.shields.io/badge/tweet-on%20Twitter-00aced.svg
   :target: https://twitter.com/PythonPillow
   :alt: Follow on https://twitter.com/PythonPillow