-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update catalog metadata when removing cropping info #146
Conversation
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.
looks good, i changed it a bit, so that the CroppingInfoRemovedEvent is not fired when the crop is changed, but only when the crop is removed.
if height >= 65536: | ||
# special case for "flexible height" settings: | ||
# we calculate the height with the box ratio | ||
box_width = self.box[2] - self.box[0] | ||
box_height = self.box[3] - self.box[1] | ||
height = int(round(width / box_width * box_height)) |
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.
@petschki why is that code in this unrelated PR ?
If you confirm it is just an omission on master, I merge this, no problem 👍
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.
Sorry, I was working on this too on Saturdays sprint and so the title of the PR is a bit missleading. This is needed in order to scale down correctly when cropping the "flexible height" scale. Otherwise It ended up in square scaled image always.
In general I'm not really happy with this hardcoded pixel value, but it works for the new OOTB image scales though. If one creates a custom scale with "100x65000" she/he might get messed 😁
Note: Somehow I could not do this via
CroppingInfoRemovedEvent
because this didn't get fired. In addition, the event gets fired when changing the cropping information too, so the object had been reindexed twice...