[IMP] Add missing tests for graphics ZPL2 feature

This commit is contained in:
Florent de Labarre
2018-01-23 00:56:02 +01:00
committed by Lois Rilo
parent 2b02938cd8
commit 15d8bf5100
2 changed files with 97 additions and 1 deletions

View File

@@ -121,8 +121,9 @@ class PrintingLabelZpl2(models.Model):
zpl2.ARG_ROUNDING: component.rounding,
})
elif component.component_type == 'graphic':
image = component.graphic_image or data
pil_image = Image.open(io.BytesIO(
base64.b64decode(component.graphic_image or data)))
base64.b64decode(image)))
if component.width and component.height:
pil_image = pil_image.resize(
(component.width, component.height))