diff --git a/.gitignore b/.gitignore index a2a3dc417..0a642e562 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ dist .tox *.so docs/_build + +# Vim cruft +.*.swp diff --git a/PIL/Image.py b/PIL/Image.py index 75e7efc75..7713fe7d9 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -1965,7 +1965,7 @@ def fromarray(obj, mode=None): else: ndmax = 4 if ndim > ndmax: - raise ValueError("Too many dimensions.") + raise ValueError("Too many dimensions: %d > %d." % (ndim, ndmax)) size = shape[1], shape[0] if strides is not None: @@ -2018,7 +2018,7 @@ def open(fp, mode="r"): """ if mode != "r": - raise ValueError("bad mode") + raise ValueError("bad mode %r" % mode) if isPath(fp): filename = fp @@ -2054,7 +2054,8 @@ def open(fp, mode="r"): #traceback.print_exc() pass - raise IOError("cannot identify image file") + raise IOError("cannot identify image file %r" + % (filename if filename else fp)) # # Image processing.