.. image:: https://travis-ci.org/aptivate/ckanext-datasetthumbnail.svg?branch=master
:target: https://travis-ci.org/aptivate/ckanext-datasetthumbnail
.. image:: https://coveralls.io/repos/aptivate/ckanext-datasetthumbnail/badge.svg
:target: https://coveralls.io/r/aptivate/ckanext-datasetthumbnail
.. image:: https://pypip.in/download/ckanext-datasetthumbnail/badge.svg
:target: https://pypi.python.org/pypi//ckanext-datasetthumbnail/
:alt: Downloads
.. image:: https://pypip.in/version/ckanext-datasetthumbnail/badge.svg
:target: https://pypi.python.org/pypi/ckanext-datasetthumbnail/
:alt: Latest Version
.. image:: https://pypip.in/py_versions/ckanext-datasetthumbnail/badge.svg
:target: https://pypi.python.org/pypi/ckanext-datasetthumbnail/
:alt: Supported Python versions
.. image:: https://pypip.in/status/ckanext-datasetthumbnail/badge.svg
:target: https://pypi.python.org/pypi/ckanext-datasetthumbnail/
:alt: Development Status
.. image:: https://pypip.in/license/ckanext-datasetthumbnail/badge.svg
:target: https://pypi.python.org/pypi/ckanext-datasetthumbnail/
:alt: License
========================
ckanext-datasetthumbnail
This CKAN extension adds support for generation and display of thumbnail
images. The helper function thumbnail_url can be called from a template, as in this example:
::
{% block thumbnail %}
{% set thumbnail = h.thumbnail_url(package.id) %}
{% if thumbnail %}
<a href="{{ h.url_for(controller='package', action='read', id=package.name) }}">
<img class="dataset-list-thumbnail" src="{{ thumbnail }}">
</a>
{% endif %}
{% endblock %}
- If a resource exists with the name
thumbnail.png, this will be used.
- If no resource exists with this name and the logged-in user has sufficient access, the thumbnail will be generated from the first matching JPEG or PNG resource.
- If no thumbnail exists at this point, a placeholder image wil