コード例 #1
0
 public function buildConfiguration()
 {
     $config = Configuration::fromEnvironmentVariable(CloudinaryEnvironmentVariable::fromString($this->getEnvironmentVariable()));
     if ($this->getCdnSubdomainFlag()) {
         $config->enableCdnSubdomain();
     }
     $config->getDefaultTransformation()->withGravity(Gravity::fromString($this->getDefaultGravity()))->withFetchFormat(FetchFormat::fromString($this->getFetchFormat()))->withQuality(Quality::fromString($this->getImageQuality()))->withDpr(Dpr::fromString($this->getImageDpr()));
     return $config;
 }
コード例 #2
0
 function it_overrides_quality_if_provided()
 {
     $transformationArray = self::builder()->withQuality(Quality::fromString('100'))->build();
     $transformationArray->offsetGet('quality')->shouldBe('100');
 }