public static function cloudinary_scaled_url($source, $width, $transformation, $options)
    {
        if (!empty($transformation)) {
            // Replace transformation parameters in $options with those in $transformation

            if(is_string($transformation)){
                $transformation = array("raw_transformation"=> $transformation);
            }
            $options = self::array_subset($options, self::$URL_KEYS);
            $options = array_merge($options, $transformation);
        }

        $scale_transformation = ["crop" => "scale", "width" => $width];

        self::check_cloudinary_field($source, $options);
        self::patch_fetch_format($options);
        $options = self::chain_transformations($options, $scale_transformation);

        return cloudinary_url_internal($source, $options);
    }