Merge branch 'kaedroho-image-focal-point-chooser-fixes' into stable/0.8.x

This commit is contained in:
Matt Westcott 2014-11-15 16:56:11 +01:00
commit 1888c5e15d
3 changed files with 8 additions and 1 deletions

View file

@ -9,6 +9,7 @@ Changelog
* Fix: Page system check for on_delete actions of ForeignKeys now only raises warnings, not errors
* Fixed a regression where form builder submissions containing a number field would fail with a JSON serialisation error
* Fix: Resizing an image with a focal point equal to the image size would result in a divide-by-zero error
* Fix: Focal point indicator would sometimes be positioned incorrectly for small or thin images
* Fix: Elasticsearch configuration now supports specifying HTTP authentication parameters as part of the URL, and defaults to ports 80 (HTTP) and 443 (HTTPS) if port number not specified

View file

@ -19,6 +19,7 @@ Bug fixes
* Page system check for on_delete actions of ForeignKeys now only raises warnings, not errors
* Fixed a regression where form builder submissions containing a number field would fail with a JSON serialisation error
* Resizing an image with a focal point equal to the image size would result in a divide-by-zero error
* Focal point indicator would sometimes be positioned incorrectly for small or thin images
* Elasticsearch configuration now supports specifying HTTP authentication parameters as part of the URL, and defaults to ports 80 (HTTP) and 443 (HTTPS) if port number not specified

View file

@ -50,13 +50,18 @@
<div class="col5">
<h2 class="label">{% trans "Focal point (optional)" %}</h2>
<p>{% trans "To define this image's most important region, drag a box over the image below." %} {% if image.focal_point %}({% trans "Current focal point shown" %}){% endif %}</p>
{% image image max-800x600 as rendition %}
<div class="focal-point-chooser"
style="max-width: {{ rendition.width }}px; max-height: {{ rendition.height }}px;"
data-focal-point-x="{{ image.focal_point_x }}"
data-focal-point-y="{{ image.focal_point_y }}"
data-focal-point-width="{{ image.focal_point_width }}"
data-focal-point-height="{{ image.focal_point_height }}">
{% image image max-800x600 data-original-width=image.width data-original-height=image.height %}
<img {{ rendition.attrs }} data-original-width="{{ image.width }}" data-original-height="{{ image.height }}">
<div class="current-focal-point-indicator{% if not image.focal_point %} hidden{% endif %}"></div>
</div>