--- parser3/src/classes/image.C 2010/10/21 15:06:27 1.136 +++ parser3/src/classes/image.C 2011/11/23 12:17:22 1.138 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_IMAGE_C="$Date: 2010/10/21 15:06:27 $"; +static const char * const IDENT_IMAGE_C="$Date: 2011/11/23 12:17:22 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -890,18 +890,18 @@ static void _create(Request& r, MethodPa static void _gif(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); - const String *file_name=0; - if(params.count()>0) - file_name=¶ms.as_string(0, FILE_NAME_MUST_BE_STRING); + const String *file_name=params.count()>0?¶ms.as_string(0, FILE_NAME_MUST_BE_STRING):0; 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, - file_name? file_name->taint_cstr(String::L_FILE_SPEC): 0, - content_type); + + vfile.set(false/*not tainted*/, + (const char*)buf.ptr, buf.size, + file_name, + new VString(*new String("image/gif"))); + + vfile.set_mode(false/*binary*/); r.write_no_lang(vfile); }