Skip to content
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

Create ImageBox.thumbnail when ImageBox.image is being set #361

Merged
merged 2 commits into from
Jul 4, 2021

Conversation

cydanil
Copy link
Collaborator

@cydanil cydanil commented Jul 4, 2021

Description

This closes #357 , in which it's described how a recipe cannot be modified, because of a save error when serializing the image and its thumbnail.
The problem is that the thumbnail attribute was only created when loading an image from file, and not when loading the image from bytes (ie. from the database.)
This resolves the issue by moving the thumbnail creation to whenever the image is loaded.

How Has This Been Tested?

This was tested by editing the title of a recipe (Hong Kong ice cream -> Hong-Kong ice cream).
Without the changes, an AttributeError is raised.
With the changes, the application behaves as expected.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

cydanil added 2 commits July 5, 2021 00:57
Correct ImageBox.commit type hinting; reformat ImageBox.__init__
@cydanil cydanil merged commit e8110e3 into kirienko:master Jul 4, 2021
@cydanil cydanil deleted the fix/357 branch July 4, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit new recipe fails
1 participant