--- parser3/src/classes/image.C 2021/11/09 15:04:26 1.183 +++ parser3/src/classes/image.C 2024/10/20 13:38:31 1.188 @@ -1,8 +1,8 @@ /** @file Parser: @b image parser class. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ /* @@ -26,7 +26,7 @@ #include "pa_table.h" #include "pa_charsets.h" -volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.183 2021/11/09 15:04:26 moko Exp $"; +volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.188 2024/10/20 13:38:31 moko Exp $"; // defines @@ -438,7 +438,7 @@ static Value* parse_IFD_entry_formatted_ HashStringValue& hash=result->hash(); for(uint i=0; iwidth); @@ -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); }