File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
vips extension changelog
2
2
3
+ Version 1.0.1 (2016-12-06)
4
+ --------------------------
5
+ * vips_image_write_to_file() was not setting options, see #3
6
+
3
7
Version 1.0.0 (2016-11-24)
4
8
--------------------------
5
9
* Update package for pecl upload
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
/* Uncomment for some logging.
6
- #define VIPS_DEBUG
7
6
*/
7
+ #define VIPS_DEBUG
8
8
9
9
#ifdef HAVE_CONFIG_H
10
10
#include "config.h"
@@ -1243,6 +1243,11 @@ PHP_FUNCTION(vips_image_write_to_file)
1243
1243
size_t filename_len ;
1244
1244
zval * options = NULL ;
1245
1245
VipsImage * image ;
1246
+ char path_string [VIPS_PATH_MAX ];
1247
+ char option_string [VIPS_PATH_MAX ];
1248
+ const char * operation_name ;
1249
+ zval argv [2 ];
1250
+ int argc ;
1246
1251
1247
1252
VIPS_DEBUG_MSG ("vips_image_write_to_file:\n" );
1248
1253
@@ -1258,11 +1263,25 @@ PHP_FUNCTION(vips_image_write_to_file)
1258
1263
1259
1264
VIPS_DEBUG_MSG ("\t%p -> %s\n" , image , filename );
1260
1265
1261
- if (vips_image_write_to_file (image , filename , NULL )) {
1266
+ vips__filename_split8 (filename , path_string , option_string );
1267
+ if (!(operation_name = vips_foreign_find_save (path_string ))) {
1262
1268
RETURN_LONG (-1 );
1263
1269
}
1264
1270
1265
- RETURN_LONG (0 );
1271
+ ZVAL_STRINGL (& argv [0 ], filename , filename_len );
1272
+ argc = 1 ;
1273
+ if (options ) {
1274
+ ZVAL_ARR (& argv [1 ], Z_ARR_P (options ));
1275
+ argc += 1 ;
1276
+ }
1277
+
1278
+ if (vips_php_call_array (operation_name , IM ,
1279
+ option_string , argc , argv , return_value )) {
1280
+ zval_dtor (& argv [0 ]);
1281
+ RETURN_LONG (-1 );
1282
+ }
1283
+
1284
+ zval_dtor (& argv [0 ]);
1266
1285
}
1267
1286
/* }}} */
1268
1287
You can’t perform that action at this time.
0 commit comments