Skip to content

Commit

Permalink
Fix argument name (#7653)
Browse files Browse the repository at this point in the history
* Fix argument name

* Fix typo
  • Loading branch information
SchrodingersGat authored Jul 15, 2024
1 parent 38ad83e commit fc0a860
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/docs/stock/stock.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions src/backend/InvenTree/report/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit fc0a860

Please sign in to comment.