php 5.3 - Imagick setSamplingFactors in php -
i using imagick in php create image property "chroma subsampling" 4:2:2 (2x1,1x1,1x1)
i use code:
$image = new imagick('test.jpg'); $factors = array("2,1,1"); $image->setsamplingfactors($factors); $image->writeimage('test2.jpg'); $image->destroy();
but result is:
jpeg:sampling-factor: 2x2,1x1,1x1
to see image's properties; use:
$image = new imagick(test2.jpg'); $identify = $image->identifyimage(true); $data = $identify['rawoutput'];
i want set:
jpeg:sampling-factor: 2x1,1x1,1x1
thanks in advance , time
i found 1 solution using shell_exec,
<?php $path = "e3.jpg"; $path2 = "e3.jpg"; $arr = array("-sampling-factor 4:2:2"); $properties = ""; foreach ($arr $property) { $properties .= $property." "; } $cmd = "convert ".$path." ".$properties." ".$path2; shell_exec($cmd); ?>
i hope find right solution using imagick methods.
Comments
Post a Comment