--- parser3/src/classes/image.C 2024/09/11 21:07:36 1.185 +++ parser3/src/classes/image.C 2024/09/28 14:37:53 1.187 @@ -26,7 +26,7 @@ #include "pa_table.h" #include "pa_charsets.h" -volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.185 2024/09/11 21:07:36 moko Exp $"; +volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.187 2024/09/28 14:37:53 moko Exp $"; // defines @@ -629,7 +629,7 @@ static void measure_jpeg(const String& o { // Segments that contain size info if(reader.read(buf, sizeof(JPG_Size_segment_body))width); @@ -960,7 +960,7 @@ static void measure(const String& file_n else throw Exception(IMAGE_FORMAT, &file_name, "unhandled file name extension '%s'", cext); } else - throw Exception(IMAGE_FORMAT, &file_name, "can not determine file type - no file name extension"); + throw Exception(IMAGE_FORMAT, &file_name, "cannot determine file type - no file name extension"); } // methods @@ -1075,7 +1075,7 @@ static gdImage* load(Request& r, const S throw Exception(IMAGE_FORMAT, &file_name, "is not in GIF format"); return image; } else { - throw Exception("file.missing", 0, "can not open '%s'", file_name_cstr); + throw Exception("file.missing", 0, "cannot open '%s'", file_name_cstr); } } @@ -1440,8 +1440,8 @@ static void _circle(Request& r, MethodPa gdImage& as_image(MethodParams& params, int index, const char* msg) { Value& value=params.as_no_junction(index, msg); - if(Value* vimage=value.as(VIMAGE_TYPE)) { - return static_cast(vimage)->image(); + if(VImage* vimage=dynamic_cast(&value)) { + return vimage->image(); } else throw Exception(PARSER_RUNTIME, 0, msg); }