예제 #1
0
 /**
  * @param KrakenOptions $options
  * @param string|null   $url
  *
  * @return CompressResponse
  */
 public static function fromUrl(KrakenOptions $options, $url = null)
 {
     if ($url !== null) {
         $options->setSourceImageUrl($url);
     }
     $apiEndpoint = sprintf('%s/url', self::API_URL);
     $curl = new Curl();
     $curl->post($apiEndpoint, json_encode($options->getConfiguredOptions()));
     return self::parseResponse($curl);
 }