From 61e9ef2ec02de4b62683b60a84f3cced32f70c71 Mon Sep 17 00:00:00 2001 From: "Mohar, Boaz" Date: Thu, 30 Jun 2016 15:53:57 -0400 Subject: [PATCH] Add file name to error message when multi page tif has wrong number of planes and discard_extra is False --- thunder/images/readers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thunder/images/readers.py b/thunder/images/readers.py index 8ee99b64..d2987459 100644 --- a/thunder/images/readers.py +++ b/thunder/images/readers.py @@ -374,7 +374,8 @@ def getarray(idx_buffer_filename): pageCount = pageCount - extra logging.getLogger('thunder').warn('Ignored %d pages in file %s' % (extra, fname)) else: - raise ValueError("nplanes '%d' does not evenly divide '%d'" % (nplanes, pageCount)) + raise ValueError("nplanes '%d' does not evenly divide '%d in file %s'" % (nplanes, pageCount, + fname)) values = [ary[i:(i+nplanes)] for i in range(0, pageCount, nplanes)] else: values = [ary]