-
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
embedart: write candidate image only if it is "similar" to already embedded one (suite) #974
Conversation
Most clients other than Library._fetch know what type they have!
The type tests now live where they ought to live.
This turned out to be less useful than I was hoping.
Models can now have a dict of special sort classes.
The mock wasn't being triggered; these tests were going to the network. Now we don't match on the query string and instead test that it was correct by actually parsing it.
It would be nice to cache the Sort object so we didn't have to re-parse this every time...
This is basically always what you want, so now you can just use the name of the field without "smart".
This makes fast SQL queries for singletons possible
Uses the new API from the previous commit and fixes beetbox#963. There is a possible issue with backwards compatibility: Changes to the item in the 'write' event do not propagate to the tags anymore. But I'm not aware of other plugins that use the API in that way.
Zero plugin can modify tags without changing the item
Reproduces beetbox#970
Fixes regression from 3197795 and makes tests from 56aba87 pass. Fixes beetbox#970
Update type of last_played to library.DateType().
Conflicts: test/test_embedart.py
Problem with python 2.6:
If someone have an idea how to work around that... by raising a custom error (matching the py2.7 error signature) that we will define at the top of the file? |
Hmm... it looks like you're using this to capture the stderr of the command when the invocation fails. You probably already thought about this, but is this really necessary? Could you invoke the comparison command so that, when it fails, you know the images are too dissimilar? Alternatively, you could consider just not using the |
I thought not, but after checking Edit (after testing) : actually, no. Changing the dissimilarity-threshold does not yield any result regarding the return code value. |
we used to parse `convert` output but `convert` happens to be a Windows cli command too. using `identify` is less error prone.
@sampsyo if it s OK with u, I d like to merge that PR. Got another one comin up =] |
embedart: write candidate image only if it is "similar" to already embedded one (suite)
LGTM! All merged up. See minor changes above (mainly docs, some style). |
added a note concerning the doc. |
Original issue : #848
Continuation of work started by PR #966
Taken from the docs :
Additional commit infos :
26ec2b8
: I kinda hacked ArtResizer original goal, using it only to inform me if IM is installed or not. In the long term we might want to do some other basics operations and renaming the class into ArtProcessor or something would fit better I think.a06c27
: what's tricky here is thatcompare
return code is1
in case of non match, yet the two images in such case may be judged as similar from a human point of view. So I needed to interpret the printed diff value even whenCalledProcessError
is raised. Maybe this edit tocommand_output
could be done more elegantly ?187497c
: I don't know what range of values cancompare -metric PHASH
return ([0, ?]), so I decided to let user set the threshold and hinting at a reasonable max in the docs (100)