--- parser3/src/classes/image.C 2024/12/06 22:03:58 1.193 +++ parser3/src/classes/image.C 2024/12/11 03:22:23 1.195 @@ -26,7 +26,7 @@ #include "pa_table.h" #include "pa_charsets.h" -volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.193 2024/12/06 22:03:58 moko Exp $"; +volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.195 2024/12/11 03:22:23 moko Exp $"; // defines @@ -1096,7 +1096,7 @@ static gdImage* load(Request& r, const S static void _load(Request& r, MethodParams& params) { - const String& file_name=params.as_string(0, FILE_NAME_MUST_BE_STRING); + const String& file_name=params.as_file_name(0); gdImage* image=load(r, file_name); GET_SELF(r, VImage).set(&file_name, image->SX(), image->SY(), image); @@ -1347,12 +1347,12 @@ void Font::string_display(gdImage& image static void _font(Request& r, MethodParams& params) { - const String& alphabet=params.as_string(0, "alphabet must not be code"); + const String& alphabet=params.as_string(0, "alphabet must be string"); size_t alphabet_length=alphabet.length(r.charsets.source()); if(!alphabet_length) throw Exception(PARSER_RUNTIME, 0, "alphabet must not be empty"); - gdImage* image=load(r, params.as_string(1, FILE_NAME_MUST_BE_STRING)); + gdImage* image=load(r, params.as_file_name(1)); int spacebar_width=image->SX(); int monospace_width=0; // proportional @@ -1399,14 +1399,14 @@ static void _font(Request& r, MethodPara static void _text(Request& r, MethodParams& params) { int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); - const String& s=params.as_string(2, "text must not be code"); + const String& s=params.as_string(2, "text must be string"); VImage& vimage=GET_SELF(r, VImage); vimage.font().string_display(vimage.image(), x, y, s); } static void _length(Request& r, MethodParams& params) { - const String& s=params.as_string(0, "text must not be code"); + const String& s=params.as_string(0, "text must be string"); VImage& vimage=GET_SELF(r, VImage); r.write(*new VInt(vimage.font().string_width(s)));