Skip to content

Instantly share code, notes, and snippets.

@thrashr888
Created March 14, 2012 19:44
Show Gist options
  • Select an option

  • Save thrashr888/2038954 to your computer and use it in GitHub Desktop.

Select an option

Save thrashr888/2038954 to your computer and use it in GitHub Desktop.
'width': 460, 'height': 460, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/>
'width': 460, 'height': 460, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/>
'width':620, 'height':380, 'method': 'crop'}) }}" alt="" />
'width': 140, 'height': 120, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="{{ article.promo_title|raw }}" />
'width':220, 'height':180, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="" />
'width': 122, 'height': 72, 'method': 'scaleAndCrop'}) }}"/>
'width': 134, 'height': 134, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}"/>
'width':424, 'height':200, 'method': 'scaleAndCrop'}) }}" alt="" />
'width':50, 'height':50, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="" /></span>
'width': 134, 'height': 134, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}"/>
'width': 130, 'height': 130, 'method': 'crop', 'allowUpscale': true}) }}"/>
'width':220, 'height':220, 'method': 'scaleAndCrop', 'allowUpscale': true})}}" alt="" />
'width': 140, 'height': 120, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}" alt="" />
'width':70, 'height':80, 'method': 'scaleAndCrop'}) }}" alt="" /></span>
'width':193, 'height':193, 'method': 'scaleAndCrop', 'allowUpscale': false})) }}" alt="" />
'width': 200, 'height': 200, 'method': 'scaleAndCrop', 'allowUpscale': true}) }}" alt="" />
'width': 140, 'height': 120, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}" alt="{{ article._title|raw }}" />
'width': 134, 'height': 134, 'method': 'crop', 'allowUpscale': true}) }}"/>
'width': 260, 'height': 146, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/></a>
'width': 120, 'height': 70, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/></a>
'width': 120, 'height': 70, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/></a>
'width': 120, 'height': 70, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}"/></a>
'width': 140, 'height': 120, 'method': 'scaleAndCrop', 'allowUpscale': false}) }}" />
image_sizes: ['460_460_sc', '620_380_c', '140_120_scu']
kinds are c, cu, s, su, sc, scu
if ($this->method == "crop") {
$method = "c";
}
else if ($this->method == "scale") {
$method = "s";
}
else if ($this->method == "scaleAndCrop") {
$method = "sc";
}
else {
$method = "";
}
return $this->width . "_" . $this->height . $method . ($this->upscale ? "u" : "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment