Upgrade pillow to 6.2.0 (#27581)
This commit is contained in:
parent
bb2a1cd439
commit
bbafeb5da2
8 changed files with 21 additions and 26 deletions
|
@ -3,7 +3,7 @@
|
||||||
"name": "Image processing",
|
"name": "Image processing",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/image_processing",
|
"documentation": "https://www.home-assistant.io/integrations/image_processing",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pillow==6.1.0"
|
"pillow==6.2.0"
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"camera"
|
"camera"
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
"""Proxy camera platform that enables image processing of camera data."""
|
"""Proxy camera platform that enables image processing of camera data."""
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from datetime import timedelta
|
||||||
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from datetime import timedelta
|
from PIL import Image
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
|
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
|
||||||
from homeassistant.const import CONF_ENTITY_ID, CONF_NAME, CONF_MODE
|
from homeassistant.const import CONF_ENTITY_ID, CONF_MODE, CONF_NAME
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
@ -58,9 +60,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||||
|
|
||||||
def _precheck_image(image, opts):
|
def _precheck_image(image, opts):
|
||||||
"""Perform some pre-checks on the given image."""
|
"""Perform some pre-checks on the given image."""
|
||||||
from PIL import Image
|
|
||||||
import io
|
|
||||||
|
|
||||||
if not opts:
|
if not opts:
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
try:
|
try:
|
||||||
|
@ -77,9 +76,6 @@ def _precheck_image(image, opts):
|
||||||
|
|
||||||
def _resize_image(image, opts):
|
def _resize_image(image, opts):
|
||||||
"""Resize image."""
|
"""Resize image."""
|
||||||
from PIL import Image
|
|
||||||
import io
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
img = _precheck_image(image, opts)
|
img = _precheck_image(image, opts)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
@ -125,8 +121,6 @@ def _resize_image(image, opts):
|
||||||
|
|
||||||
def _crop_image(image, opts):
|
def _crop_image(image, opts):
|
||||||
"""Crop image."""
|
"""Crop image."""
|
||||||
import io
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
img = _precheck_image(image, opts)
|
img = _precheck_image(image, opts)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Proxy",
|
"name": "Proxy",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/proxy",
|
"documentation": "https://www.home-assistant.io/integrations/proxy",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pillow==6.1.0"
|
"pillow==6.2.0"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": []
|
"codeowners": []
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
"""The qrcode component."""
|
"""The QR code component."""
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
"""Support for the QR image processing."""
|
"""Support for the QR code image processing."""
|
||||||
from homeassistant.core import split_entity_id
|
import io
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
|
from pyzbar import pyzbar
|
||||||
|
|
||||||
from homeassistant.components.image_processing import (
|
from homeassistant.components.image_processing import (
|
||||||
ImageProcessingEntity,
|
|
||||||
CONF_SOURCE,
|
|
||||||
CONF_ENTITY_ID,
|
CONF_ENTITY_ID,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
|
CONF_SOURCE,
|
||||||
|
ImageProcessingEntity,
|
||||||
)
|
)
|
||||||
|
from homeassistant.core import split_entity_id
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the demo image processing platform."""
|
"""Set up the QR code image processing platform."""
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
entities = []
|
entities = []
|
||||||
for camera in config[CONF_SOURCE]:
|
for camera in config[CONF_SOURCE]:
|
||||||
|
@ -19,7 +24,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
|
|
||||||
|
|
||||||
class QrEntity(ImageProcessingEntity):
|
class QrEntity(ImageProcessingEntity):
|
||||||
"""QR image processing entity."""
|
"""A QR image processing entity."""
|
||||||
|
|
||||||
def __init__(self, camera_entity, name):
|
def __init__(self, camera_entity, name):
|
||||||
"""Initialize QR image processing entity."""
|
"""Initialize QR image processing entity."""
|
||||||
|
@ -49,10 +54,6 @@ class QrEntity(ImageProcessingEntity):
|
||||||
|
|
||||||
def process_image(self, image):
|
def process_image(self, image):
|
||||||
"""Process image."""
|
"""Process image."""
|
||||||
import io
|
|
||||||
from pyzbar import pyzbar
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
stream = io.BytesIO(image)
|
stream = io.BytesIO(image)
|
||||||
img = Image.open(stream)
|
img = Image.open(stream)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Qrcode",
|
"name": "Qrcode",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/qrcode",
|
"documentation": "https://www.home-assistant.io/integrations/qrcode",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pillow==6.1.0",
|
"pillow==6.2.0",
|
||||||
"pyzbar==0.1.7"
|
"pyzbar==0.1.7"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
|
|
|
@ -953,7 +953,7 @@ pilight==0.1.1
|
||||||
# homeassistant.components.image_processing
|
# homeassistant.components.image_processing
|
||||||
# homeassistant.components.proxy
|
# homeassistant.components.proxy
|
||||||
# homeassistant.components.qrcode
|
# homeassistant.components.qrcode
|
||||||
pillow==6.1.0
|
pillow==6.2.0
|
||||||
|
|
||||||
# homeassistant.components.dominos
|
# homeassistant.components.dominos
|
||||||
pizzapi==0.0.3
|
pizzapi==0.0.3
|
||||||
|
|
|
@ -328,7 +328,7 @@ pilight==0.1.1
|
||||||
# homeassistant.components.image_processing
|
# homeassistant.components.image_processing
|
||||||
# homeassistant.components.proxy
|
# homeassistant.components.proxy
|
||||||
# homeassistant.components.qrcode
|
# homeassistant.components.qrcode
|
||||||
pillow==6.1.0
|
pillow==6.2.0
|
||||||
|
|
||||||
# homeassistant.components.plex
|
# homeassistant.components.plex
|
||||||
plexapi==3.0.6
|
plexapi==3.0.6
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue