-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix label size #21
Fix label size #21
Conversation
@evmosseveld what tape sizes have you tested this on? |
Currently I only have the 29mm x 90mm die-cut tape to test it with, so I don't know if it works for all labels. The problem I was having was that the label wouldn't print because the brother_ql library only accepts the image if it's precisely the correct size (at least for my media type, but I suspect it's the same for all die-cut tapes). So I needed to resize the image (as stated in the code ideally there would be a GUI in InvenTree to configure sizing options just as you have printing options in desktop applications for example). Also, I don't know if this would be the right place to fix this or if it would be better to fix this in the brother_ql library so that it accepts all image sizes and resizes the image itself. |
Btw I was wondering which things were meant by these 2 TODOs:
The resizing I have now implemented, is that what was meant by 'padding' in the TODO? |
inventree_brother/brother_plugin.py
Outdated
# TODO: correctly handle case where label image is bigger than printable area | ||
for media_specifications in ALL_LABELS: | ||
if media_specifications.identifier == media_type: | ||
printable_dimensions = media_specifications.dots_printable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will want to handle the case where printable_dimensions
is not set here
inventree_brother/brother_plugin.py
Outdated
if media_specifications.identifier == media_type: | ||
printable_dimensions = media_specifications.dots_printable | ||
printable_image = Image.new("RGB", printable_dimensions, "white") | ||
margin_left = (printable_dimensions[0] - label_image.width) // 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should handle the case where these calculations would result in negative values
…added exception handling
Do you have some images of this working with the printer please? :) I don't have a printer available for testing right now |
@evmosseveld thanks for the improvements, I'll push a new release |
No description provided.