-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for vips_image_write_to_file options
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--TEST-- | ||
write_to_file can set options | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("vips")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
$filename = dirname(__FILE__) . "/images/img_0076.jpg"; | ||
$image = vips_image_new_from_file($filename)["out"]; | ||
$output_filename1 = dirname(__FILE__) . "/x.jpg"; | ||
$output_filename2 = dirname(__FILE__) . "/y.jpg"; | ||
|
||
vips_image_write_to_file($image, $output_filename1, ["Q" => 20]); | ||
vips_image_write_to_file($image, $output_filename2, ["Q" => 90]); | ||
|
||
$buffer1 = file_get_contents($output_filename1); | ||
$buffer2 = file_get_contents($output_filename2); | ||
|
||
if (strlen($buffer1) < strlen($buffer2)) { | ||
echo "pass"; | ||
} | ||
?> | ||
--EXPECT-- | ||
pass | ||
--CLEAN-- | ||
<?php | ||
$output_filename = dirname(__FILE__) . "/x.jpg"; | ||
unlink($output_filename); | ||
$output_filename = dirname(__FILE__) . "/y.jpg"; | ||
unlink($output_filename); | ||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
*/ | ||
|
||
/* Uncomment for some logging. | ||
*/ | ||
#define VIPS_DEBUG | ||
*/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include "config.h" | ||
|