From 2e5b4effbc5e7f7ac74cae541a05d3401c9170b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Feb 2013 21:35:44 +0000 Subject: Throw an exception rather than asserting when unable to handle a pixel format (#65). --- src/lib/image.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/image.cc') diff --git a/src/lib/image.cc b/src/lib/image.cc index 73d499fe8..ae87304c2 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -70,7 +70,7 @@ Image::lines (int n) const case PIX_FMT_YUV422P: return size().height; default: - assert (false); + throw PixelFormatError ("lines()", _pixel_format); } return 0; @@ -89,7 +89,7 @@ Image::components () const case PIX_FMT_RGBA: return 1; default: - assert (false); + throw PixelFormatError ("components()", _pixel_format); } return 0; @@ -202,7 +202,7 @@ Image::post_process (string pp, bool aligned) const pp_format = PP_FORMAT_422; break; default: - assert (false); + throw PixelFormatError ("post_process", pixel_format()); } pp_mode* mode = pp_get_mode_by_name_and_quality (pp.c_str (), PP_QUALITY_MAX); -- cgit v1.2.3