Skip to content

Commit

Permalink
Merge pull request #17 from KeyteqLabs/focal-point-setting
Browse files Browse the repository at this point in the history
Introduce a setting for scaler strategy to not use focal points
  • Loading branch information
nervetattoo committed Nov 4, 2013
2 parents 74d80d3 + a397ae5 commit 90268f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
_eZ on the Edge_ extension from [Github](https://github.com/KeyteqLabs/ezote)

* Exceed 1.1 installations should use `legacy` branch
* Exceed 2 installations should use the following tags:
* _exceed-2.0.0-rc.3_ <= 2.0.0-rc.3
* _exceed-2.0.0-rc.4_ >= 2.0.0-rc.4
* Exceed 2 installations should use latest `master`


### Using composer
Expand Down Expand Up @@ -53,6 +51,10 @@ Setting up versions the user should be able to produce, is done in the keymedia.
This is the possible settings with examples:

```ini
# Disable using focal point scaler strategy
[Scaler]
FocalPoint=false

[Brightcove]
PlayerId=98234987523
PlayerKey=OM932489MGXCV009CXVOM3
Expand Down
11 changes: 10 additions & 1 deletion design/standard/templates/content/datatype/view/image.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<img src="{$media.url}"
{if is_set($focalPoint)|not}
{def $focalPoint = true()}
{if eq( 'false', ezini('Scaler', 'FocalPoint', 'keymedia.ini') ) }
{set $focalPoint = false()}
{/i}
{/if}
{if $format|is_array|not}
{set $focalPoint = false()}
{/if}
<img src="{$media.url}{if $focalPoint|not}?original=1{/if}"
{if is_set($class)}class="{$class}"{/if}
{if is_set($width)}width="{$width}"{/if}
{if is_set($height)}height="{$height}"{/if}
Expand Down
3 changes: 3 additions & 0 deletions settings/keymedia.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#?ini charset="utf-8"?
[KeyMedia]
EditSize=400

[Scaler]
FocalPoint=true

0 comments on commit 90268f4

Please sign in to comment.