Closed marhub closed 7 years ago
Oh dear, you're right, vips_image_write_to_file()
was not handling options at all.
I've added this, added a test, and upload 1.0.2 with the fix to pecl.
With this program:
#!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';
use Jcupitt\Vips;
$im = Vips\Image::newFromFile($argv[1]);
$im->writeToFile($argv[2], ["Q" => 20]);
$im->writeToFile($argv[3], ["Q" => 90]);
I now see:
john@kiwi:~/try$ ./try241.php ~/pics/k2.jpg x.jpg y.jpg
john@kiwi:~/try$ ls -l x.jpg y.jpg
-rw-r--r-- 1 john john 92440 Dec 6 10:15 x.jpg
-rw-r--r-- 1 john john 386676 Dec 6 10:15 y.jpg
Thank you very much for reporting this dumbness!
I confirm that now it's working.
I'm trying to set quality of jpg file. Code is simple:
this is not working.
However if i set it in $filePath, it is working correctly: