wCMF 4.1
Guides
Getting started
Architecture
Model
Persistence
Presentation
Configuration
Security
I18n & l10n
Tests
Versions
4.1.x
4.0.x
API
Classes
Hierarchy
Code
Support
home
travis
build
iherwig
wcmf
src
wcmf
application
views
plugins
modifier.ratio.php
1
<?php
2
/**
3
* wCMF - wemove Content Management Framework
4
* Copyright (C) 2005-2020 wemove digital solutions GmbH
5
*
6
* Licensed under the terms of the MIT License.
7
*
8
* See the LICENSE file distributed with this work for
9
* additional information.
10
*/
11
12
/**
13
* Get the aspect ratio of the given image
14
*
15
* Example:
16
* @code
17
* {if $image|ratio < 1.78}
18
* ...aspect ratio of image is smaller than 16:9, e.g 4:3...
19
* {else}
20
* ...
21
* {/if}
22
* @endcode
23
*
24
* @param $image The image file
25
* @return Float
26
*/
27
function
smarty_modifier_ratio($image) {
28
$size = getimagesize($image);
29
return
$size[0]/$size[1];
30
}
31
?>