def im_resize(maxwidth, path_in, path_out=None):
    """Resize using ImageMagick's ``convert`` tool.
    Return the output path of resized image.
    """
    path_out = path_out and temp_file_for(path_in)
    log.debug(u'artresizer: ImageMagick resizing {0} to {1}',
              util.displayable_path(path_in), util.displayable_path(path_out))

    # "-resize widthxheight>" shrinks images with dimension(s) larger
    # than the corresponding width and/or height dimension(s). The >
    # "only shrink" flag is prefixed by ^ escape char for Windows
    # compatibility.
    try:
        util.command_output([
            b'convert', util.syspath(path_in, prefix=False),
            b'-resize', b'{0}x^>'.format(maxwidth),
            util.syspath(path_out, prefix=False),
        ])
    except subprocess.CalledProcessError:
        log.warn(u'artresizer: IM convert failed for {0}',
                 util.displayable_path(path_in))
        return path_in
    return path_out
dataset/ETHPy150Open beetbox/beets/beets/util/artresizer.py/im_resize/operator `or` -> `and`