--- parser3/src/classes/image.C 2002/08/01 11:26:43 1.73 +++ parser3/src/classes/image.C 2002/08/15 09:07:48 1.75 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_IMAGE_C="$Id: image.C,v 1.73 2002/08/01 11:26:43 paf Exp $"; +static const char* IDENT_IMAGE_C="$Date: 2002/08/15 09:07:48 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -792,15 +792,17 @@ static void _circle(Request& r, const St gdImage& as_image(Pool& pool, const String& method_name, MethodParams *params, int index, const char *msg) { - Value& value=params->as_no_junction(index, msg); + gdImage *src=0; - if(strcmp(value.type(), VIMAGE_TYPE)!=0) - throw Exception("parser.runtime", - &method_name, - msg); + Value& value=params->as_no_junction(index, msg); - gdImage *src=static_cast(&value)->image; - if(!src) + if(Value *vimage=value.as(VIMAGE_TYPE, false)) { + src=static_cast(vimage)->image; + if(!src) + throw Exception("parser.runtime", + &method_name, + msg); + } else throw Exception("parser.runtime", &method_name, msg);