--- parser3/src/classes/image.C 2003/07/24 11:31:20 1.91 +++ parser3/src/classes/image.C 2003/11/03 11:22:06 1.95 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_IMAGE_C="$Date: 2003/07/24 11:31:20 $"; +static const char* IDENT_IMAGE_C="$Date: 2003/11/03 11:22:06 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -410,7 +410,7 @@ static Value* parse_IFD_entry_formatted_ strcpy(cstr_writable, cstr); time_t t=cstr_to_time_t(cstr_writable, - 0/* do not throw exception, just return bad result */); + false/* do not throw exception, just return bad result */); if(t>=0) return new VDate(t); } @@ -427,7 +427,7 @@ static Value* parse_IFD_entry_formatted_ HashStringValue& hash=result->hash(); for(uint i=0; i0) + file_name=¶ms.as_string(0, "file name must be string"); gdBuf buf=image->Gif(); VFile& vfile=*new VFile; Value* content_type=new VString(*new String("image/gif")); vfile.set(false/*not tainted*/, - (const char*)buf.ptr, buf.size, 0, content_type); + (const char*)buf.ptr, buf.size, + file_name? file_name->cstr(String::L_FILE_SPEC): 0, + content_type); r.write_no_lang(vfile); } @@ -921,7 +925,7 @@ static void _replace(Request& r, MethodP 0, "coordinates must be table"); - gdImage::Point *all_p=new gdImage::Point[table->count()]; + gdImage::Point *all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image->FilledPolygonReplaceColor(all_p, table->count(), @@ -943,7 +947,7 @@ static void _polyline(Request& r, Method 0, "coordinates must be table"); - gdImage::Point* all_p=new gdImage::Point[table->count()]; + gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image->Polygon(all_p, table->count(), @@ -965,7 +969,7 @@ static void _polygon(Request& r, MethodP 0, "coordinates must be table"); - gdImage::Point* all_p=new gdImage::Point[table->count()]; + gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image->Polygon(all_p, table->count(), @@ -986,7 +990,7 @@ static void _polybar(Request& r, MethodP 0, "coordinates must be table"); - gdImage::Point* all_p=new gdImage::Point[table->count()]; + gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image->FilledPolygon(all_p, table->count(), @@ -1242,7 +1246,7 @@ MImage::MImage(): Methoded("image") { add_native_method("create", Method::CT_DYNAMIC, _create, 2, 3); // ^image.gif[] - add_native_method("gif", Method::CT_DYNAMIC, _gif, 0, 0); + add_native_method("gif", Method::CT_DYNAMIC, _gif, 0, 1); // ^image.line(x0;y0;x1;y1;color) add_native_method("line", Method::CT_DYNAMIC, _line, 5, 5);