-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow mutiple operations on image file for fetchart plugin #4606
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.
This looks very nice; thanks for getting this started! I really like the design of breaking up the problematically-monolithic field check
on the Candidate
object into several independent flags. This seems to do the trick at first glance.
I added a couple of notes suggesting that we expand docstrings to explain the flow of data through these fields, which will make this code easier for humans in the future to deal with.
Could you also please add a quick changelog entry describing what changed?
"""Determine whether the candidate artwork is valid based on | ||
its dimensions (width and ratio). |
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.
It looks like this method now has side effects. That is, it assigns to the self.{downscale,downsize,reformat}
fields that otherwise default to false. This should probably be documented here so it's clear that there is a stateful update happening.
|
||
def validate(self, plugin): | ||
self.check = self._validate(plugin) | ||
return self.check | ||
|
||
def resize(self, plugin): | ||
if self.check == self.CANDIDATE_DOWNSCALE: | ||
def adjust(self, plugin): |
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.
Similarly, it would be really useful to add a docstring here that says that this method is sensitive to the various flags on the Candidate
object.
Ideally, the plugin would do all the required conversions in one pass, so that it doesn't introduce quality loss for each re-encoding (and disregard the quality setting completely in some cases). |
I agree. However, the current code is still a useful first step to fix the immediate issue; doing the single-pass conversion is a bigger project that requires adding this functionality in the |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Just checking whether @vicobarberan might be interested in doing another iteration on this PR so we can land it! |
I was looking at open issues to work on and came across this. Idk how I missed it when I created a similar PR a month ago to address this issue. It seems to have been inactive for over a year. I respect the work done by the author of the existing PR, and I am leaving this message here just to link both of them. To the author of the existing PR, I hope you don't mind me submitting a new PR. If you plan to update your PR, please let me know and I'd be happy to close mine. |
Description
Fixes #4452