-
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
New ImageMagick params for im_getsize() #2122
Conversation
Prevents im_getsize from crashing with ImageMagick native package on Synology NAS
Interesting; thank you for discovering the problem and investigating! There's a downside to this exact fix: it can, unfortunately, decrease the chance of success on Windows. See #2093—the summary is that |
@sampsyo We could detect Windows (or Linux) installations using |
Sure, good point—an explicit platform check could be an OK shortcut without adding a full configuration option. |
We are going to have to do something a little different from the way we do it now in any case. Compare http://packages.ubuntu.com/trusty/amd64/imagemagick/filelist to http://packages.ubuntu.com/precise/amd64/imagemagick/filelist You'll see that they now use an |
That's rather frustrating too—but it's another argument that we should just make the path configurable, if there really is a substantial diversity of names where IM can be installed. |
I think we should first go with a descending priority list (like bash completion). It should cover most cases. I do think there's a case for configurable path though. It'd be easy to imagine a situation where beets could otherwise run, but the packaged imagemagick version can't handle what we want. |
Something we could try out would be a "lookup" table, where we have a table with a list of commands to try and the expected output. We would try them in order to work out what the real binary is, e.g. IMAGEMAGICK_LOOKUP = [
{
'command': 'identify',
'check': {
'command': 'identify --version',
'output_match': '^Version: ImageMagick'
}
},
{
'command': 'convert -identify',
'check': {
'command': 'convert --version',
'output_match': '^Version: ImageMagick'
}
},
{
'command': 'identify.im6',
'check': {
'command': 'identify.im6 --version',
'output_match': '^Version: ImageMagick'
}
},
{
'command': 'convert.im6 -identify',
'check': {
'command': 'convert.im6 --version',
'output_match': '^Version: ImageMagick'
}
}
] We'd then iterate each |
Yeah! That would be a great way to make the adaptation extensible. We could do this series of tests in place of the current simple existence check. |
as long as we memoize it, it should be ok. |
Looks good to me |
@sampsyo: it looks like imagemagick 7 now skips with a |
So, i talked to some folks who actually use Debian and learned that the |
Good to know; thanks for investigating. It would be good to eventually transition to that |
@sampsyo : we'll be stuck with convert and friends for awhile though! If we can provide a platform specific fix for windows, then I think we should be able to rely on |
Yep! I agree completely. |
so instead of the full path, we could ask the windows registry!! http://www.imagemagick.org/Usage/windows/#convert_issue
|
We use these tools in all sorts of places.. I'm a little confused as to how and where we can centralize these imagemagick binary lookups and still provide the full path option. should it be in art.py? |
Yep, an abstraction layer in the art module seems right. Sorry for terse responses lately! I swear I have a good excuse... |
@Tstassin I know it's been some time since you opened this pull request, but do you still intend to continue work on it? |
I don't remember what I changed or if this has been corrected since then, but it seems to work now for me and I don't intend to work anymore on it. |
I guess that this is fixed by #3236 |
Prevents im_getsize from crashing when using ImageMagick native package on Synology NAS
Issue #2121