@@ -89,7 +89,6 @@ impl ImageOutput {
8989 /// Note: `image` dimensions and type will take precendence over the ImageSpec
9090 pub fn write < T : Type , C : Color > ( mut self , image : & Image < T , C > ) -> Result < ( ) , Error > {
9191 let base_type = T :: BASE ;
92- let name = C :: NAME . as_bytes ( ) . as_ptr ( ) as * const _ ;
9392 let path: & std:: path:: Path = self . path . as_ref ( ) ;
9493 let path_str = std:: ffi:: CString :: new ( path. to_string_lossy ( ) . as_bytes ( ) . to_vec ( ) ) . unwrap ( ) ;
9594 let filename = path_str. as_ptr ( ) ;
@@ -98,16 +97,12 @@ impl ImageOutput {
9897 let out = self . image_output ;
9998 let spec = & mut self . spec ;
10099 unsafe {
101- cpp ! ( [ out as "ImageOutput*" , name as "const char *" , filename as "const char *" , base_type as "TypeDesc::BASETYPE" , spec as "ImageSpec *" , width as "size_t" , height as "size_t" , channels as "size_t" , pixels as "const void*" ] {
100+ cpp ! ( [ out as "ImageOutput*" , filename as "const char *" , base_type as "TypeDesc::BASETYPE" , spec as "ImageSpec *" , width as "size_t" , height as "size_t" , channels as "size_t" , pixels as "const void*" ] {
102101 ImageSpec outspec ( * spec) ;
103102 outspec. width = width;
104103 outspec. height = height;
105104 outspec. nchannels = channels;
106- auto x = std:: vector<std:: string>( channels) ;
107- for ( int i = 0 ; i < channels; i++) {
108- x[ i] = std:: string( 1 , name[ i] ) ;
109- }
110- outspec. channelnames = x;
105+ outspec. channelnames. assign( { "R" , "G" , "B" , "A" } ) ;
111106 outspec. set_format( TypeDesc ( base_type) ) ;
112107 out->open ( filename, outspec) ;
113108 out->write_image ( base_type, pixels) ;
0 commit comments