Fix argument name (#7653)

* Fix argument name

* Fix typo
This commit is contained in:
Oliver 2024-07-15 13:54:29 +10:00 committed by GitHub
parent 38ad83e401
commit fc0a860e9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ A stock location represents a physical real-world location where *Stock Items* a
## Stock Location Type
A stock location type represents a specific type of location (e.g. one specifc size of drawer, shelf, ... or box) which can be assigned to multiple stock locations. In the first place, it is used to specify an icon and having the icon in sync for all locations that use this location type, but it also serves as a data field to quickly see what type of location this is. It is planned to add e.g. drawer dimension information to the location type to add a "find a matching, empty stock location" tool.
A stock location type represents a specific type of location (e.g. one specific size of drawer, shelf, ... or box) which can be assigned to multiple stock locations. In the first place, it is used to specify an icon and having the icon in sync for all locations that use this location type, but it also serves as a data field to quickly see what type of location this is. It is planned to add e.g. drawer dimension information to the location type to add a "find a matching, empty stock location" tool.
## Stock Item

View File

@ -78,21 +78,21 @@ def report_page_size_default():
return page_size
def encode_image_base64(image, format: str = 'PNG'):
def encode_image_base64(image, img_format: str = 'PNG'):
"""Return a base-64 encoded image which can be rendered in an <img> tag.
Arguments:
image: {Image} -- Image to encode
format: {str} -- Image format (default = 'PNG')
img_format: {str} -- Image format (default = 'PNG')
Returns:
str -- Base64 encoded image data e.g. 'data:image/png;base64,xxxxxxxxx'
"""
fmt = format.lower()
img_format = str(img_format).lower()
buffered = io.BytesIO()
image.save(buffered, fmt)
image.save(buffered, img_format)
img_str = base64.b64encode(buffered.getvalue())
return f'data:image/{fmt};charset=utf-8;base64,' + img_str.decode()
return f'data:image/{img_format};charset=utf-8;base64,' + img_str.decode()