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

Fix: Image in related table #1768

Merged

Conversation

steff-o
Copy link
Contributor

@steff-o steff-o commented May 12, 2023

Fixes #1757

Problem was that there was an asynchronous resize when the form is saved which messed up the current layer state variable.

Resolved by moving the resize to when the file is loaded (which in my opinion is more logical anyway). Previous implementation resized the image on save, which meant that the preview image was full resolution and the image was read twice.

The result should be the same which includes that the image is always resized to a max size of 600 pixels in the largest dimension. That can be overridden by setting a new max size by the undocumented maxSize option.

"attributes": [
        {
          "name": "name",
          "type": "text"
        },
        {
          "name": "imgsrc",
          "type": "image",
          "maxSize":  50
        }
      ]

@steff-o
Copy link
Contributor Author

steff-o commented May 24, 2023

@leafisfalling, can you test this?

@Owemyr
Copy link

Owemyr commented Jun 2, 2023

We have tested the image in related table fix, working fine, thanks.

Copy link
Collaborator

@johnnyblasta johnnyblasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested without related table and this fixes #1787 also.
Since it seems from two different parties that it solves when related table also, so it's good to merge then.

@jokd
Copy link
Contributor

jokd commented Jun 21, 2023

Agree, merge this

@johnnyblasta johnnyblasta linked an issue Jun 21, 2023 that may be closed by this pull request
@johnnyblasta johnnyblasta merged commit 6891f76 into origo-map:master Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants