├── COPYING ├── .gitignore ├── django_image_tools ├── __init__.py ├── tests │ ├── __init__.py │ ├── urls.py │ └── settings.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── templates │ ├── single_image.html │ └── single_image_component.html ├── urls.py ├── views.py ├── admin.py └── settings.py ├── requirements.txt ├── design ├── Django Image Tools icon.sketch │ ├── version │ ├── Data │ ├── QuickLook │ │ ├── Preview.png │ │ └── Thumbnail.png │ └── metadata └── images │ └── django-image-tools-icon@2x.png ├── MANIFEST.in ├── htmlcov ├── keybd_open.png ├── keybd_closed.png ├── jquery.isonscreen.js ├── django_image_tools___init__.html ├── django_image_tools_tests___init__.html ├── jquery.hotkeys.js ├── style.css ├── jquery.tablesorter.min.js └── coverage_html.js ├── docs ├── build │ ├── html │ │ ├── objects.inv │ │ ├── _static │ │ │ ├── up.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── comment.png │ │ │ ├── up-pressed.png │ │ │ ├── ajax-loader.gif │ │ │ ├── down-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── django-image-tools-icon.png │ │ │ ├── fonts │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ │ ├── js │ │ │ │ └── theme.js │ │ │ ├── css │ │ │ │ └── badge_only.css │ │ │ ├── pygments.css │ │ │ ├── default.css │ │ │ ├── sidebar.js │ │ │ ├── doctools.js │ │ │ ├── basic.css │ │ │ └── underscore.js │ │ ├── _images │ │ │ └── django-image-tools-icon.png │ │ ├── .buildinfo │ │ ├── _sources │ │ │ ├── how_works.txt │ │ │ ├── index.txt │ │ │ ├── more_features.txt │ │ │ ├── testing.txt │ │ │ ├── quickstart.txt │ │ │ └── how_to_use.txt │ │ ├── genindex.html │ │ ├── search.html │ │ ├── searchindex.js │ │ ├── how_works.html │ │ ├── more_features.html │ │ ├── index.html │ │ └── testing.html │ └── doctrees │ │ ├── index.doctree │ │ ├── testing.doctree │ │ ├── environment.pickle │ │ ├── how_to_use.doctree │ │ ├── how_works.doctree │ │ ├── quickstart.doctree │ │ └── more_features.doctree ├── source │ ├── _static │ │ └── django-image-tools-icon.png │ ├── how_works.rst │ ├── index.rst │ ├── more_features.rst │ ├── testing.rst │ ├── quickstart.rst │ ├── how_to_use.rst │ └── conf.py └── Makefile ├── dist ├── django-image-tools-v1.0.tar.gz ├── django-image-tools-0.6.1.b.tar.gz ├── django-image-tools-0.6.b.tar.gz ├── django-image-tools-0.6.b3.tar.gz ├── django-image-tools-0.6.b4.tar.gz ├── django-image-tools-0.6.b5.tar.gz ├── django-image-tools-0.6b3.tar.gz ├── django-image-tools-0.7.b1.tar.gz ├── django-image-tools-0.8.b1.tar.gz ├── django-image-tools-0.8.b2.tar.gz └── django-image-tools-2-v1.0.tar.gz ├── AUTHORS ├── manage.py ├── MANIFEST ├── .travis.yml ├── LICENSE ├── setup.py ├── README.rst └── .coverage /COPYING: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | htmlcov 2 | venv 3 | -------------------------------------------------------------------------------- /django_image_tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /django_image_tools/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==3.0.0 2 | -------------------------------------------------------------------------------- /django_image_tools/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /design/Django Image Tools icon.sketch/version: -------------------------------------------------------------------------------- 1 | 18 -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.rst 2 | include LICENSE 3 | include README.rst 4 | -------------------------------------------------------------------------------- /django_image_tools/templates/single_image.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /htmlcov/keybd_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/htmlcov/keybd_open.png -------------------------------------------------------------------------------- /htmlcov/keybd_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/htmlcov/keybd_closed.png -------------------------------------------------------------------------------- /docs/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/objects.inv -------------------------------------------------------------------------------- /docs/build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/up.png -------------------------------------------------------------------------------- /docs/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/down.png -------------------------------------------------------------------------------- /docs/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/file.png -------------------------------------------------------------------------------- /docs/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/plus.png -------------------------------------------------------------------------------- /dist/django-image-tools-v1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-v1.0.tar.gz -------------------------------------------------------------------------------- /docs/build/doctrees/testing.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/testing.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/comment.png -------------------------------------------------------------------------------- /dist/django-image-tools-0.6.1.b.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6.1.b.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.6.b.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6.b.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.6.b3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6.b3.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.6.b4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6.b4.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.6.b5.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6.b5.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.6b3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.6b3.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.7.b1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.7.b1.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.8.b1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.8.b1.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-0.8.b2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-0.8.b2.tar.gz -------------------------------------------------------------------------------- /dist/django-image-tools-2-v1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/dist/django-image-tools-2-v1.0.tar.gz -------------------------------------------------------------------------------- /docs/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/build/doctrees/how_to_use.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/how_to_use.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/how_works.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/how_works.doctree -------------------------------------------------------------------------------- /docs/build/doctrees/quickstart.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/quickstart.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /design/Django Image Tools icon.sketch/Data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/design/Django Image Tools icon.sketch/Data -------------------------------------------------------------------------------- /docs/build/doctrees/more_features.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/doctrees/more_features.doctree -------------------------------------------------------------------------------- /docs/build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/comment-close.png -------------------------------------------------------------------------------- /design/images/django-image-tools-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/design/images/django-image-tools-icon@2x.png -------------------------------------------------------------------------------- /docs/source/_static/django-image-tools-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/source/_static/django-image-tools-icon.png -------------------------------------------------------------------------------- /docs/build/html/_images/django-image-tools-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_images/django-image-tools-icon.png -------------------------------------------------------------------------------- /docs/build/html/_static/django-image-tools-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/django-image-tools-icon.png -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/build/html/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/docs/build/html/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /design/Django Image Tools icon.sketch/QuickLook/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/design/Django Image Tools icon.sketch/QuickLook/Preview.png -------------------------------------------------------------------------------- /design/Django Image Tools icon.sketch/QuickLook/Thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonsaistudio/django-image-tools/HEAD/design/Django Image Tools icon.sketch/QuickLook/Thumbnail.png -------------------------------------------------------------------------------- /django_image_tools/templates/single_image_component.html: -------------------------------------------------------------------------------- 1 | {% extends "base_component.html" %} 2 | {% block component_content %} 3 | 4 | {% endblock component_content %} 5 | -------------------------------------------------------------------------------- /django_image_tools/tests/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | from django.contrib import admin 3 | 4 | admin.autodiscover() 5 | 6 | urlpatterns = patterns('', 7 | url(r'^admin/', include(admin.site.urls)), 8 | ) 9 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Django-image-tools was started as a DRY app to hold all images and learn python and django. 2 | 3 | Started by 4 | Bonsai Studio 5 | 6 | Main Contributors 7 | ================= 8 | 9 | Gabriele Platania 10 | Giuseppe Caruso -------------------------------------------------------------------------------- /docs/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: e7aa1de550a9feca323c208b004fcfaa 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_image_tools.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | # file GENERATED by distutils, do NOT edit 2 | LICENSE 3 | README.rst 4 | setup.py 5 | django_image_tools/__init__.py 6 | django_image_tools/admin.py 7 | django_image_tools/models.py 8 | django_image_tools/settings.py 9 | django_image_tools/urls.py 10 | django_image_tools/views.py 11 | django_image_tools/migrations/0001_initial.py 12 | django_image_tools/migrations/__init__.py 13 | -------------------------------------------------------------------------------- /docs/source/how_works.rst: -------------------------------------------------------------------------------- 1 | How it works 2 | ============ 3 | 4 | The app only creates the image the first time it is requested. So don't worry about the system clogging 5 | because you have 10.0000 images and you create a new size on the fly, or having your server filled up with cached 6 | images that are never used. 7 | The images are also cached, so you should never experience a notable lag, unless you request a bunch of images 8 | of a size that was never processed. 9 | The app uses an md5 checksum to check if the image was changed. This way, it can detect even if the image was 10 | replaced by some other app, (or the user) and reprocess the various sizes of that image on request. -------------------------------------------------------------------------------- /design/Django Image Tools icon.sketch/metadata: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | app 6 | com.bohemiancoding.sketch 7 | build 8 | 5355 9 | commit 10 | b7d299b0a34651d1a0e066786b75aa36168d5809 11 | fonts 12 | 13 | Avenir-Black 14 | Avenir-Light 15 | 16 | length 17 | 160805 18 | version 19 | 18 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/build/html/_sources/how_works.txt: -------------------------------------------------------------------------------- 1 | How it works 2 | ============ 3 | 4 | The app only creates the image the first time it is requested. So don't worry about the system clogging 5 | because you have 10.0000 images and you create a new size on the fly, or having your server filled up with cached 6 | images that are never used. 7 | The images are also cached, so you should never experience a notable lag, unless you request a bunch of images 8 | of a size that was never processed. 9 | The app uses an md5 checksum to check if the image was changed. This way, it can detect even if the image was 10 | replaced by some other app, (or the user) and reprocess the various sizes of that image on request. -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.7 4 | - 3.3 5 | - 3.5 6 | - pypy 7 | env: 8 | - DJANGO=1.7 9 | - DJANGO=1.8 10 | - DJANGO=1.9 11 | before_install: 12 | - export DJANGO_SETTINGS_MODULE=django_image_tools.tests.settings 13 | install: 14 | - pip install -q Django==$DJANGO 15 | - pip install -r requirements.txt 16 | - pip install coveralls 17 | - pip install . 18 | script: 19 | - python manage.py migrate --noinput && coverage run --source=django_image_tools --omit=*django_migrations*,*admin* manage.py test django_image_tools 20 | after_success: 21 | - coveralls 22 | matrix: 23 | exclude: 24 | # Fails. Django issue 25 | # https://gist.github.com/thefourtheye/2205fe8ff7974e2cebf6 26 | - python: 3.5 27 | env: DJANGO=1.7 28 | # Deprecated version 29 | - python: 3.3 30 | env: DJANGO=1.8 31 | env: DJANGO=1.9 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # Created by Bonsai Studio 2 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 4 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 6 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 7 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 8 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 9 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 10 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | # Copyright (C) Bonsai Studio 13 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup(name='django-image-tools-2', 4 | version='v1.0', 5 | description='Image tools for Django', 6 | author='Gabriele Platania', 7 | author_email='gabriele.platania@gmail.com', 8 | url='http://github.com/bonsaistudio/django-image-tools', 9 | license='BSD', 10 | keywords='django image filter tools resize crop', 11 | long_description=open('README.rst').read(), 12 | classifiers=[ 13 | 'Development Status :: 5 - Production/Stable', 14 | 'Framework :: Django', 15 | 'Environment :: Web Environment', 16 | 'License :: OSI Approved :: BSD License', 17 | 'Programming Language :: Python', 18 | ], 19 | install_requires=[ 20 | 'Pillow', 21 | ], 22 | packages=['django_image_tools', 'django_image_tools.migrations'], 23 | ) 24 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Django Image Tools 2 | ================== 3 | 4 | .. image:: https://travis-ci.org/bonsaistudio/django-image-tools.svg?branch=master 5 | 6 | .. image:: https://pypip.in/version/django-image-tools/badge.png 7 | 8 | .. image:: https://pypip.in/license/django-image-tools/badge.png 9 | 10 | .. image:: https://pypip.in/download/django-image-tools/badge.png 11 | 12 | .. image:: https://coveralls.io/repos/bonsaistudio/django-image-tools/badge.png 13 | 14 | Django Image Tools is a small app that will allow you to manage your project's images without worrying much about image sizes, how to crop them, etc.. 15 | All you have to do is to define your website sizes and filters and the app will do the rest for you. 16 | 17 | Check out the `official docs on readthedocs! `_ 18 | 19 | Django Image Tools uses Travis CI to test the integration with several versions of Python and Django. 20 | You can see the list of currently supported combinations on our `Travis CI page 21 | `_. 22 | 23 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. Django Image Tools documentation master file, created by 2 | sphinx-quickstart on Fri May 30 10:34:36 2014. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Django Image Tools's documentation! 7 | ============================================== 8 | .. image:: https://travis-ci.org/bonsaistudio/django-image-tools.svg?branch=master 9 | 10 | .. image:: https://pypip.in/version/django-image-tools/badge.png 11 | 12 | .. image:: https://pypip.in/license/django-image-tools/badge.png 13 | 14 | .. image:: https://pypip.in/download/django-image-tools/badge.png 15 | 16 | .. image:: https://coveralls.io/repos/bonsaistudio/django-image-tools/badge.png 17 | 18 | .. image:: /_static/django-image-tools-icon.png 19 | 20 | Contents: 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | 25 | quickstart 26 | how_to_use 27 | how_works 28 | more_features 29 | testing 30 | 31 | 32 | 33 | Indices and tables 34 | ================== 35 | 36 | * :ref:`genindex` 37 | * :ref:`modindex` 38 | * :ref:`search` 39 | 40 | -------------------------------------------------------------------------------- /docs/build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. Django Image Tools documentation master file, created by 2 | sphinx-quickstart on Fri May 30 10:34:36 2014. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Django Image Tools's documentation! 7 | ============================================== 8 | .. image:: https://travis-ci.org/bonsaistudio/django-image-tools.svg?branch=master 9 | 10 | .. image:: https://pypip.in/version/django-image-tools/badge.png 11 | 12 | .. image:: https://pypip.in/license/django-image-tools/badge.png 13 | 14 | .. image:: https://pypip.in/download/django-image-tools/badge.png 15 | 16 | .. image:: https://coveralls.io/repos/bonsaistudio/django-image-tools/badge.png 17 | 18 | .. image:: /_static/django-image-tools-icon.png 19 | 20 | Contents: 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | 25 | quickstart 26 | how_to_use 27 | how_works 28 | more_features 29 | testing 30 | 31 | 32 | 33 | Indices and tables 34 | ================== 35 | 36 | * :ref:`genindex` 37 | * :ref:`modindex` 38 | * :ref:`search` 39 | 40 | -------------------------------------------------------------------------------- /django_image_tools/urls.py: -------------------------------------------------------------------------------- 1 | # Created by Bonsai Studio 2 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 4 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 6 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 7 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 8 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 9 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 10 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | # Copyright (C) Bonsai Studio 13 | 14 | from __future__ import absolute_import 15 | from django.conf.urls import patterns, url 16 | from .views import ComponentImage, SingleImage 17 | 18 | urlpatterns = [ 19 | url(r'^(?P\d)/component$', ComponentImage.as_view()), 20 | url(r'^(?P\d)$', SingleImage.as_view()), 21 | ] -------------------------------------------------------------------------------- /django_image_tools/views.py: -------------------------------------------------------------------------------- 1 | # Created by Bonsai Studio 2 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 4 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 6 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 7 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 8 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 9 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 10 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | # Copyright (C) Bonsai Studio 13 | 14 | from __future__ import absolute_import 15 | from django.views.generic import DetailView 16 | from .models import Image 17 | 18 | 19 | class SingleImage(DetailView): 20 | model = Image 21 | template_name = u'single_image.html' 22 | 23 | 24 | class ComponentImage(DetailView): 25 | model = Image 26 | template_name = u'single_image_component.html' 27 | -------------------------------------------------------------------------------- /django_image_tools/admin.py: -------------------------------------------------------------------------------- 1 | # Created by Bonsai Studio 2 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 4 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 6 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 7 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 8 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 9 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 10 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | # Copyright (C) Bonsai Studio 13 | 14 | from __future__ import absolute_import 15 | from django.contrib import admin 16 | from .models import Image 17 | 18 | class ImageAdmin(admin.ModelAdmin): 19 | exclude = ('was_upscaled', 'checksum') 20 | list_display = ('thumbnail', 'image', 'title') 21 | list_filter = ('was_upscaled', ) 22 | search_fields = ('title', ) 23 | 24 | def suit_row_attributes(self, obj, request): 25 | return {'class': 'error' if obj.was_upscaled else 'success'} 26 | 27 | admin.site.register(Image, ImageAdmin) 28 | 29 | -------------------------------------------------------------------------------- /docs/source/more_features.rst: -------------------------------------------------------------------------------- 1 | More features 2 | ============= 3 | 4 | The images will all be available in the admin panel. You can browse and search through all of them. 5 | Sometimes, the users will upload a 'small' image (You know users right?) and then they'll complain that the image 6 | doesn't scale well, or it's too jpegged. 7 | The app will automatically flag all images for which an upscaled version was requested, by flagging them with the 8 | 'was_upscaled' flag (if you're using django_suit, the background of the row will also be displayed red). You can use 9 | the filter in the app to see which one were upscaled, and delete them, or replace them with a higher-res version. 10 | The original images will never be touched, unless the user wants to rename them. 11 | The cached image folder can be changed in the system settings, through the settings variable 12 | 'DJANGO_IMAGE_TOOLS_CACHE_DIR'. This will always be a sub dir of the 'MEDIA' dir, though I might change this 13 | in the future. 14 | I strongly advice you to use the 'raw_id_fields' for the image fields, as it will allow the user to search for a 15 | previously submitted image or input a new one with a nice popup menu. This will decrease the number of duplicates. 16 | If there is a 'thumbnail' size, the app will display images of that size for the admin panel, otherwise it will fall 17 | back on the original. 18 | You can fetch the original image path by requesting 'image.get__original'. -------------------------------------------------------------------------------- /docs/build/html/_sources/more_features.txt: -------------------------------------------------------------------------------- 1 | More features 2 | ============= 3 | 4 | The images will all be available in the admin panel. You can browse and search through all of them. 5 | Sometimes, the users will upload a 'small' image (You know users right?) and then they'll complain that the image 6 | doesn't scale well, or it's too jpegged. 7 | The app will automatically flag all images for which an upscaled version was requested, by flagging them with the 8 | 'was_upscaled' flag (if you're using django_suit, the background of the row will also be displayed red). You can use the filter in the app to see which one were upscaled, and delete them, or replace them with a higher-res version. 9 | The original images will never be touched, unless the user wants to rename them. 10 | The cached image folder can be changed in the system settings, through the settings variable 11 | 'DJANGO_IMAGE_TOOLS_CACHE_DIR'. This will always be a sub dir of the 'MEDIA' dir, though I might change this 12 | in the future. 13 | I strongly advice you to use the 'raw_id_fields' for the image fields, as it will allow the user to search for a 14 | previously submitted image or input a new one with a nice popup menu. This will decrease the number of duplicates. 15 | I also *strongly* advice you to remove permission for non admin users for the 'size' app, as removing a size that is 16 | used inside a template will result (obviously) in a 500 error. 17 | If there is a 'thumbnail' size, the app will display images of that size for the admin panel, otherwise it will fall 18 | back on the original. 19 | You can fetch the original image path by requesting 'image.get__original'. -------------------------------------------------------------------------------- /htmlcov/jquery.isonscreen.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 2 | * @author Laurence Wheway 3 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 4 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 5 | * 6 | * @version 1.2.0 7 | */ 8 | (function($) { 9 | jQuery.extend({ 10 | isOnScreen: function(box, container) { 11 | //ensure numbers come in as intgers (not strings) and remove 'px' is it's there 12 | for(var i in box){box[i] = parseFloat(box[i])}; 13 | for(var i in container){container[i] = parseFloat(container[i])}; 14 | 15 | if(!container){ 16 | container = { 17 | left: $(window).scrollLeft(), 18 | top: $(window).scrollTop(), 19 | width: $(window).width(), 20 | height: $(window).height() 21 | } 22 | } 23 | 24 | if( box.left+box.width-container.left > 0 && 25 | box.left < container.width+container.left && 26 | box.top+box.height-container.top > 0 && 27 | box.top < container.height+container.top 28 | ) return true; 29 | return false; 30 | } 31 | }) 32 | 33 | 34 | jQuery.fn.isOnScreen = function (container) { 35 | for(var i in container){container[i] = parseFloat(container[i])}; 36 | 37 | if(!container){ 38 | container = { 39 | left: $(window).scrollLeft(), 40 | top: $(window).scrollTop(), 41 | width: $(window).width(), 42 | height: $(window).height() 43 | } 44 | } 45 | 46 | if( $(this).offset().left+$(this).width()-container.left > 0 && 47 | $(this).offset().left < container.width+container.left && 48 | $(this).offset().top+$(this).height()-container.top > 0 && 49 | $(this).offset().top < container.height+container.top 50 | ) return true; 51 | return false; 52 | } 53 | })(jQuery); 54 | -------------------------------------------------------------------------------- /docs/source/testing.rst: -------------------------------------------------------------------------------- 1 | Testing 2 | ======= 3 | 4 | Often times you will find yourself having images required in your models, and testing these models can be a real pain in the 5 | donkey as you will have to create images just for that. 6 | 7 | We want to make things simple for you, so you can import our method 'create_dummy_image' to easily create a dummy image for your tests! 8 | 9 | :: 10 | 11 | create_dummy_image(filename=u'Test_image', title=u'Title', caption=u'Caption', alt_text=u'Alt Text', 12 | credit=u'Credit'): 13 | 14 | 15 | This will create a new dummy entry in the database, so all you have to do is to assign it to your model's Foreign Key. 16 | 17 | Remember to call 18 | 19 | :: 20 | 21 | image.delete() 22 | 23 | 24 | In your tearDown. 25 | 26 | Also, django_image_tools will never delete your images, so you will have to delete them yourself. 27 | Just kidding, we made a script for that too. 28 | 29 | :: 30 | 31 | delete_image(image) 32 | 33 | 34 | 35 | So, here's a complete script. 36 | 37 | :: 38 | 39 | def setUp(self): 40 | partnerImage = create_dummy_image() 41 | model_with_image = Model(name=u'Coca cola', image=partnerImage) 42 | partner.save() 43 | 44 | def testInsert(self): 45 | self.assertEqual(Model.objects.all()[0].name, 'Coca cola') 46 | 47 | def tearDown(self): 48 | model_with_image = Model.objects.all()[0] 49 | delete_image(model_with_image.image) 50 | model_with_image.delete() 51 | 52 | Support 53 | ------- 54 | 55 | Django Image Tools uses Travis CI to test the integration with several versions of Python and Django. 56 | You can see the list of currently supported combinations on our `Travis CI page 57 | `_. 58 | -------------------------------------------------------------------------------- /docs/build/html/_sources/testing.txt: -------------------------------------------------------------------------------- 1 | Testing 2 | ======= 3 | 4 | Often times you will find yourself having images required in your models, and testing these models can be a real pain in the 5 | donkey as you will have to create images just for that. 6 | 7 | We want to make things simple for you, so you can import our method 'create_dummy_image' to easily create a dummy image for your tests! 8 | 9 | :: 10 | 11 | create_dummy_image(filename=u'Test_image', title=u'Title', caption=u'Caption', alt_text=u'Alt Text', 12 | credit=u'Credit'): 13 | 14 | 15 | This will create a new dummy entry in the database, so all you have to do is to assign it to your model's Foreign Key. 16 | 17 | Remember to call 18 | 19 | :: 20 | 21 | image.delete() 22 | 23 | 24 | In your tearDown. 25 | 26 | Also, django_image_tools will never delete your images, so you will have to delete them yourself. 27 | Just kidding, we made a script for that too. 28 | 29 | :: 30 | 31 | delete_image(image) 32 | 33 | 34 | 35 | So, here's a complete script. 36 | 37 | :: 38 | 39 | def setUp(self): 40 | partnerImage = create_dummy_image() 41 | model_with_image = Model(name=u'Coca cola', image=partnerImage) 42 | partner.save() 43 | 44 | def testInsert(self): 45 | self.assertEqual(Model.objects.all()[0].name, 'Coca cola') 46 | 47 | def tearDown(self): 48 | model_with_image = Model.objects.all()[0] 49 | delete_image(model_with_image.image) 50 | model_with_image.delete() 51 | 52 | Support 53 | ------- 54 | 55 | Django Image Tools uses Travis CI to test the integration with several versions of Python and Django. 56 | You can see the list of currently supported combinations on our `Travis CI page 57 | `_. 58 | -------------------------------------------------------------------------------- /docs/build/html/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | // Shift nav in mobile when clicking the menu. 3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() { 4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); 5 | $("[data-toggle='rst-versions']").toggleClass("shift"); 6 | }); 7 | // Close menu when you click a link. 8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() { 9 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); 10 | $("[data-toggle='rst-versions']").toggleClass("shift"); 11 | }); 12 | $(document).on('click', "[data-toggle='rst-current-version']", function() { 13 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); 14 | }); 15 | // Make tables responsive 16 | $("table.docutils:not(.field-list)").wrap("
"); 17 | }); 18 | 19 | window.SphinxRtdTheme = (function (jquery) { 20 | var stickyNav = (function () { 21 | var navBar, 22 | win, 23 | stickyNavCssClass = 'stickynav', 24 | applyStickNav = function () { 25 | if (navBar.height() <= win.height()) { 26 | navBar.addClass(stickyNavCssClass); 27 | } else { 28 | navBar.removeClass(stickyNavCssClass); 29 | } 30 | }, 31 | enable = function () { 32 | applyStickNav(); 33 | win.on('resize', applyStickNav); 34 | }, 35 | init = function () { 36 | navBar = jquery('nav.wy-nav-side:first'); 37 | win = jquery(window); 38 | }; 39 | jquery(init); 40 | return { 41 | enable : enable 42 | }; 43 | }()); 44 | return { 45 | StickyNav : stickyNav 46 | }; 47 | }($)); 48 | -------------------------------------------------------------------------------- /django_image_tools/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2015-12-02 17:39 3 | from __future__ import unicode_literals 4 | 5 | import django.core.validators 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | initial = True 12 | 13 | dependencies = [ 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Image', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('image', models.ImageField(help_text='uploading an image will take time. DO NOT PUSH THE SAVE BUTTON AGAIN UNTIL THE IMAGE HAS BEEN SAVED!', max_length=500, upload_to='/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/tests/media/upload')), 22 | ('checksum', models.CharField(max_length=32)), 23 | ('filename', models.SlugField(help_text='If you want to rename the image, write here the new filename', validators=[django.core.validators.RegexValidator(message="Filename can only contain letters, numbers and '-'.No extensions allowed (I'll put it for you", regex='^[A-Za-z\\-\\_0-9]*$')])), 24 | ('subject_position_horizontal', models.PositiveSmallIntegerField(choices=[(0, 'Left'), (1, '1/3'), (2, 'Center'), (3, '2/3'), (4, 'Right')], default=2, help_text='The system will create other imagesfrom this, based on the image sizes needed.In some cases, it is necessary to cropthe image. By selecting where the subject is, the croppingcan be more accurate.', verbose_name='Subject Horizontal Position')), 25 | ('subject_position_vertical', models.PositiveSmallIntegerField(choices=[(0, 'Top'), (1, '1/3'), (2, 'Center'), (3, '2/3'), (4, 'Bottom')], default=2, help_text='The system will create other imagesfrom this, based on the image sizes needed.In some cases, it is necessary to cropthe image. By selecting where the subject is, the croppingcan be more accurate.', verbose_name='Subject Vertical Position')), 26 | ('was_upscaled', models.BooleanField(default=False, verbose_name='insufficient_resolution')), 27 | ('title', models.CharField(help_text='In some pages it might be necessary to display some informations.', max_length=120)), 28 | ('caption', models.TextField()), 29 | ('alt_text', models.CharField(help_text='This is the text that allows blind people (and google) know what the image is about ', max_length=120)), 30 | ('credit', models.TextField(blank=True, null=True)), 31 | ], 32 | ), 33 | ] 34 | -------------------------------------------------------------------------------- /django_image_tools/tests/settings.py: -------------------------------------------------------------------------------- 1 | # Django settings for test project. 2 | import os 3 | 4 | DEBUG = True 5 | TEMPLATE_DEBUG = DEBUG 6 | DEBUG_PROPAGATE_EXCEPTIONS = True 7 | 8 | ADMINS = () 9 | MANAGERS = ADMINS 10 | 11 | DATABASES = { 12 | 'default': { 13 | 'ENGINE': 'django.db.backends.sqlite3', 14 | 'NAME': 'testdb', 15 | } 16 | } 17 | 18 | 19 | TIME_ZONE = 'Europe/Riga' 20 | LANGUAGE_CODE = 'en-uk' 21 | SITE_ID = 1 22 | USE_I18N = True 23 | USE_L10N = True 24 | MEDIA_ROOT = '' 25 | SECRET_KEY = 'v*%a@==!33+n3y6jzn=y(&&i%iq&@2f2q^q6jqgrfv-xv55-#n' 26 | TEST_RUNNER = 'django.test.runner.DiscoverRunner' 27 | 28 | TEMPLATE_LOADERS = ( 29 | 'django.template.loaders.filesystem.Loader', 30 | 'django.template.loaders.app_directories.Loader', 31 | ) 32 | 33 | MIDDLEWARE_CLASSES = ( 34 | 'django.middleware.common.CommonMiddleware', 35 | 'django.contrib.sessions.middleware.SessionMiddleware', 36 | 'django.middleware.csrf.CsrfViewMiddleware', 37 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 38 | 'django.contrib.messages.middleware.MessageMiddleware', 39 | ) 40 | 41 | ROOT_URLCONF = 'django_image_tools.tests.urls' 42 | TEMPLATE_DIRS = () 43 | 44 | INSTALLED_APPS = ( 45 | 'django.contrib.auth', 46 | 'django.contrib.contenttypes', 47 | 'django.contrib.sessions', 48 | 'django.contrib.sites', 49 | 'django.contrib.messages', 50 | 'django.contrib.admin', 51 | 'django_image_tools', 52 | ) 53 | 54 | import django 55 | 56 | if django.VERSION[1] < 7: 57 | INSTALLED_APPS += ( 58 | 'south', 59 | ) 60 | SOUTH_TESTS_MIGRATE = False 61 | 62 | PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) 63 | 64 | MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') 65 | MEDIA_URL = '/media/' 66 | 67 | UPLOAD_TO = os.path.join(PROJECT_ROOT, 'media/upload') 68 | 69 | DJANGO_IMAGE_TOOLS_SIZES = { 70 | 'thumbnail': { 71 | 'width': 30, 72 | 'height': 30, 73 | 'auto': None 74 | }, 75 | 'very_long': { 76 | 'width': 200, 77 | 'height': 30, 78 | 'auto': None 79 | }, 80 | 'very_tall': { 81 | 'width': 30, 82 | 'height': 200, 83 | 'auto': None 84 | }, 85 | 'huge': { 86 | 'width': 2000, 87 | 'height': 2000, 88 | 'auto': None 89 | }, 90 | 'auto_width': { 91 | 'width': 0, 92 | 'height': 20, 93 | 'auto': 'WIDTH' 94 | }, 95 | 'auto_height': { 96 | 'width': 20, 97 | 'height': 0, 98 | 'auto': 'HEIGHT' 99 | }, 100 | } 101 | 102 | DJANGO_IMAGE_TOOLS_FILTERS = { 103 | 'grey_scaled': { 104 | 'filter_type': 'GREYSCALE' 105 | }, 106 | 'blurred': { 107 | 'filter_type': 'GAUSSIAN_BLUR', 108 | 'value': 3 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /htmlcov/django_image_tools___init__.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Coverage for django_image_tools/__init__: 100% 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 36 | 37 |
38 | 39 |

Hot-keys on this page

40 |
41 |

42 | r 43 | m 44 | x 45 | p   toggle line displays 46 |

47 |

48 | j 49 | k   next/prev highlighted chunk 50 |

51 |

52 | 0   (zero) top of page 53 |

54 |

55 | 1   (one) first highlighted chunk 56 |

57 |
58 |
59 | 60 |
61 | 62 | 63 | 66 | 69 | 70 |
64 | 65 | 67 | 68 |
71 |
72 | 73 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/build/html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Index — Django Image Tools 0.7.b1 documentation 11 | 12 | 13 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 | 40 |
41 |
42 |
43 |
44 | 45 | 46 |

Index

47 | 48 |
49 | 50 |
51 | 52 | 53 |
54 |
55 |
56 |
57 |
58 | 59 | 60 | 61 | 73 | 74 |
75 |
76 |
77 |
78 | 87 | 91 | 92 | -------------------------------------------------------------------------------- /docs/build/html/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:"\f02d"}.icon-book:before{content:"\f02d"}.fa-caret-down:before{content:"\f0d7"}.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}} 2 | -------------------------------------------------------------------------------- /htmlcov/django_image_tools_tests___init__.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Coverage for django_image_tools/tests/__init__: 100% 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 36 | 37 |
38 | 39 |

Hot-keys on this page

40 |
41 |

42 | r 43 | m 44 | x 45 | p   toggle line displays 46 |

47 |

48 | j 49 | k   next/prev highlighted chunk 50 |

51 |

52 | 0   (zero) top of page 53 |

54 |

55 | 1   (one) first highlighted chunk 56 |

57 |
58 |
59 | 60 |
61 | 62 | 63 | 67 | 71 | 72 |
64 |

1

65 | 66 |
68 |

from django_image_tools.tests.tests import SimpleTest 

69 | 70 |
73 |
74 | 75 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /htmlcov/jquery.hotkeys.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Hotkeys Plugin 3 | * Copyright 2010, John Resig 4 | * Dual licensed under the MIT or GPL Version 2 licenses. 5 | * 6 | * Based upon the plugin by Tzury Bar Yochay: 7 | * http://github.com/tzuryby/hotkeys 8 | * 9 | * Original idea by: 10 | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ 11 | */ 12 | 13 | (function(jQuery){ 14 | 15 | jQuery.hotkeys = { 16 | version: "0.8", 17 | 18 | specialKeys: { 19 | 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", 20 | 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 21 | 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 22 | 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 23 | 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", 24 | 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 25 | 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" 26 | }, 27 | 28 | shiftNums: { 29 | "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", 30 | "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", 31 | ".": ">", "/": "?", "\\": "|" 32 | } 33 | }; 34 | 35 | function keyHandler( handleObj ) { 36 | // Only care when a possible input has been specified 37 | if ( typeof handleObj.data !== "string" ) { 38 | return; 39 | } 40 | 41 | var origHandler = handleObj.handler, 42 | keys = handleObj.data.toLowerCase().split(" "); 43 | 44 | handleObj.handler = function( event ) { 45 | // Don't fire in text-accepting inputs that we didn't directly bind to 46 | if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || 47 | event.target.type === "text") ) { 48 | return; 49 | } 50 | 51 | // Keypress represents characters, not special keys 52 | var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], 53 | character = String.fromCharCode( event.which ).toLowerCase(), 54 | key, modif = "", possible = {}; 55 | 56 | // check combinations (alt|ctrl|shift+anything) 57 | if ( event.altKey && special !== "alt" ) { 58 | modif += "alt+"; 59 | } 60 | 61 | if ( event.ctrlKey && special !== "ctrl" ) { 62 | modif += "ctrl+"; 63 | } 64 | 65 | // TODO: Need to make sure this works consistently across platforms 66 | if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { 67 | modif += "meta+"; 68 | } 69 | 70 | if ( event.shiftKey && special !== "shift" ) { 71 | modif += "shift+"; 72 | } 73 | 74 | if ( special ) { 75 | possible[ modif + special ] = true; 76 | 77 | } else { 78 | possible[ modif + character ] = true; 79 | possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; 80 | 81 | // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" 82 | if ( modif === "shift+" ) { 83 | possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; 84 | } 85 | } 86 | 87 | for ( var i = 0, l = keys.length; i < l; i++ ) { 88 | if ( possible[ keys[i] ] ) { 89 | return origHandler.apply( this, arguments ); 90 | } 91 | } 92 | }; 93 | } 94 | 95 | jQuery.each([ "keydown", "keyup", "keypress" ], function() { 96 | jQuery.event.special[ this ] = { add: keyHandler }; 97 | }); 98 | 99 | })( jQuery ); 100 | -------------------------------------------------------------------------------- /docs/build/html/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Search — Django Image Tools 0.7.b1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |

Search

53 |
54 | 55 |

56 | Please activate JavaScript to enable the search 57 | functionality. 58 |

59 |
60 |

61 | From here you can search these documents. Enter your search 62 | words into the box below and click "search". Note that the search 63 | function will automatically search for all of the words. Pages 64 | containing fewer words won't appear in the result list. 65 |

66 |
67 | 68 | 69 | 70 |
71 | 72 |
73 | 74 |
75 | 76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 94 | 98 | 99 | -------------------------------------------------------------------------------- /django_image_tools/settings.py: -------------------------------------------------------------------------------- 1 | # Created by Bonsai Studio 2 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 4 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 5 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 6 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 7 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 8 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 9 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 10 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | # Copyright (C) Bonsai Studio 13 | 14 | import os 15 | from django.conf import settings 16 | from django.core.exceptions import ImproperlyConfigured 17 | 18 | 19 | def get(key, default): 20 | return getattr(settings, key, default) 21 | 22 | DJANGO_IMAGE_TOOLS_CACHE_DIR = get('DJANGO_IMAGE_TOOLS_CACHE_DIR', 'cache') 23 | DJANGO_IMAGE_TOOLS_SIZES = get('DJANGO_IMAGE_TOOLS_SIZES', {'thumbnail': {'width': 50, 'height': 50}}) 24 | DJANGO_IMAGE_TOOLS_FILTERS = get('DJANGO_IMAGE_TOOLS_FILTERS', {}) 25 | MEDIA_URL = get('MEDIA_URL', '/media/') 26 | DJANGO_IMAGE_TOOLS_CACHE_ROOT = '' 27 | MEDIA_ROOT = '' 28 | UPLOAD_TO = '' 29 | 30 | TEMPLATES = [ 31 | { 32 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 33 | 'DIRS': [ 34 | # insert your TEMPLATE_DIRS here 35 | ], 36 | 'APP_DIRS': True, 37 | 'OPTIONS': { 38 | 'context_processors': [ 39 | # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this 40 | # list if you haven't customized them: 41 | 'django.contrib.auth.context_processors.auth', 42 | 'django.template.context_processors.debug', 43 | 'django.template.context_processors.i18n', 44 | 'django.template.context_processors.media', 45 | 'django.template.context_processors.static', 46 | 'django.template.context_processors.tz', 47 | 'django.contrib.messages.context_processors.messages', 48 | ], 49 | }, 50 | }, 51 | ] 52 | 53 | 54 | def update_settings(): 55 | global DJANGO_IMAGE_TOOLS_CACHE_DIR 56 | DJANGO_IMAGE_TOOLS_CACHE_DIR = get('DJANGO_IMAGE_TOOLS_CACHE_DIR', 'cache') 57 | global MEDIA_URL 58 | MEDIA_URL = get('MEDIA_URL', '/media/') 59 | global DJANGO_IMAGE_TOOLS_CACHE_ROOT 60 | global MEDIA_ROOT 61 | global UPLOAD_TO 62 | global DJANGO_IMAGE_TOOLS_SIZES 63 | global DJANGO_IMAGE_TOOLS_FILTERS 64 | 65 | 66 | try: 67 | MEDIA_ROOT = settings.MEDIA_ROOT 68 | except AttributeError: 69 | raise ImproperlyConfigured(u'Django Image Tools couldn\'t find the \'MEDIA_ROOT\'. ' 70 | u'Have you set it up in your settings.py?') 71 | 72 | if not os.path.exists(MEDIA_ROOT): 73 | os.makedirs(MEDIA_ROOT) 74 | 75 | DJANGO_IMAGE_TOOLS_CACHE_ROOT = os.path.join(MEDIA_ROOT, DJANGO_IMAGE_TOOLS_CACHE_DIR) 76 | 77 | if not os.path.exists(DJANGO_IMAGE_TOOLS_CACHE_ROOT): 78 | os.makedirs(DJANGO_IMAGE_TOOLS_CACHE_ROOT) 79 | 80 | UPLOAD_TO = get('UPLOAD_TO', '') 81 | if hasattr(settings, 'DJANGO_IMAGE_TOOLS_UPLOAD_TO'): 82 | UPLOAD_TO = settings.DJANGO_IMAGE_TOOLS_UPLOAD_TO 83 | if UPLOAD_TO is '': 84 | UPLOAD_TO = settings.MEDIA_ROOT 85 | 86 | if not os.path.exists(UPLOAD_TO): 87 | os.makedirs(UPLOAD_TO) 88 | 89 | 90 | 91 | update_settings() -------------------------------------------------------------------------------- /.coverage: -------------------------------------------------------------------------------- 1 | !coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/migrations/__init__.py": [1], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/migrations/0001_initial.py": [3, 5, 6, 9, 11, 13, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/tests/tests.py": [14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 48, 50, 54, 56, 57, 58, 59, 60, 62, 64, 66, 68, 70, 72, 74, 75, 77, 78, 80, 82, 84, 85, 87, 89, 91, 93, 95, 96, 98, 102, 103, 104, 105, 107, 111, 112, 114, 116, 117, 118, 121, 125, 126, 128, 129, 130, 131, 134, 137, 138, 140, 141, 144, 145, 146, 149, 152, 155, 158, 160, 162, 163, 166, 167, 168, 171, 174, 177, 178, 181, 183, 184, 186, 190, 192, 194, 195, 196, 197, 203, 204, 208, 209, 211, 213, 217, 218, 220, 221, 222, 223, 225, 229, 231, 232, 233, 234, 235, 236, 237, 239, 243, 245, 246, 248, 252, 253, 254, 255, 257, 258, 260, 264, 265, 266, 267, 269, 270, 271, 272, 274, 275, 276, 278, 279, 280, 282, 283, 285, 287, 290, 291, 294, 296, 297, 298, 300, 301, 302, 303, 304, 306, 307, 308, 310, 314, 315, 316, 318, 319, 322, 323, 324, 325, 326, 327, 329, 330, 332, 337, 338, 340, 342, 344, 346, 347, 348, 350, 351, 353, 354, 356, 357, 359, 363, 364, 366, 367, 370, 371], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/tests/settings.py": [2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 19, 20, 21, 22, 23, 24, 25, 26, 30, 38, 41, 42, 51, 54, 56, 62, 64, 65, 67, 69, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 95, 96, 97, 98, 102, 103, 104, 106, 107, 108], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/models.py": [512, 513, 515, 518, 520, 521, 522, 524, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 175, 540, 29, 30, 544, 545, 546, 548, 551, 552, 553, 554, 556, 557, 558, 561, 563, 564, 565, 566, 569, 573, 577, 578, 579, 582, 583, 526, 528, 109, 532, 113, 114, 531, 116, 117, 119, 120, 121, 122, 124, 128, 131, 132, 534, 134, 135, 136, 138, 141, 536, 146, 152, 538, 159, 162, 163, 165, 166, 167, 168, 169, 173, 174, 541, 176, 115, 542, 183, 184, 185, 186, 193, 195, 196, 197, 198, 199, 202, 204, 205, 206, 207, 210, 211, 213, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 233, 237, 241, 246, 247, 251, 253, 255, 256, 257, 258, 259, 260, 262, 264, 265, 267, 270, 271, 272, 273, 274, 275, 276, 277, 278, 281, 282, 283, 284, 285, 286, 287, 290, 291, 292, 293, 298, 299, 301, 303, 305, 310, 311, 313, 317, 318, 319, 320, 321, 322, 323, 324, 325, 328, 330, 331, 332, 334, 335, 336, 338, 339, 340, 342, 343, 345, 346, 348, 350, 351, 352, 355, 356, 357, 359, 360, 363, 364, 365, 367, 369, 370, 371, 372, 375, 376, 379, 380, 381, 382, 385, 386, 387, 388, 391, 398, 399, 400, 401, 402, 403, 404, 407, 415, 416, 417, 418, 419, 420, 423, 424, 425, 428, 429, 430, 431, 432, 435, 436, 437, 440, 441, 442, 445, 446, 447, 450, 451, 454, 455, 456, 457, 458, 461, 462, 463, 466, 468, 469, 470, 471, 472, 475, 476, 477, 478, 479, 480, 482, 483, 484, 485, 486, 487, 490, 492, 493, 494, 497, 499, 502, 504, 507, 508, 509, 511], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/tests/__init__.py": [1], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/urls.py": [], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/settings.py": [66, 67, 68, 86, 72, 75, 77, 14, 15, 16, 81, 82, 19, 20, 22, 23, 24, 25, 26, 27, 28, 69, 31, 32, 33, 91, 36, 37, 80, 41, 42, 43, 44, 45, 46, 47, 83, 54, 56, 84, 58], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/tests/urls.py": [], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/views.py": [], "/Users/xelhark/Developer/PyCharmProjects/django-image-tools/django_image_tools/__init__.py": [1]}} -------------------------------------------------------------------------------- /docs/build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #333333 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 44 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 45 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 46 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 47 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 48 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 49 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 50 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 51 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 52 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 53 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 54 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 55 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 56 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 57 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 58 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 59 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 60 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 61 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 62 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/build/html/_sources/quickstart.txt: -------------------------------------------------------------------------------- 1 | Quick Start 2 | =========== 3 | 4 | All you have to do is 5 | 6 | :: 7 | 8 | pip install django-image-tools 9 | 10 | and of course, add the app in your INSTALLED_APPS as 11 | 12 | :: 13 | 14 | INSTALLED_APPS = ( 15 | ... 16 | 'django_image_tools', 17 | ... 18 | ) 19 | 20 | Configuration 21 | ------------- 22 | 23 | The minimum required settings you should add in your settings.py are: 24 | 25 | :: 26 | 27 | # Folder in which you want to store your images, in this example it's the sub folder 'media' 28 | MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') 29 | # Temporary folder for upload, in this example is the subfolder 'upload' 30 | UPLOAD_TO = os.path.join(PROJECT_ROOT, 'media/upload') 31 | 32 | The folders will be created if they do not exist. 33 | 34 | 35 | That's it, you're good to go now. 36 | Let's create a couple of models containing images! 37 | 38 | 39 | Example models 40 | -------------- 41 | 42 | Let's say you have a "Person" model and you want to include an Avatar, or a profile pic. Here's how you do it 43 | 44 | :: 45 | 46 | .... 47 | from django_image_tools.models import Image 48 | 49 | class Person(models.Model): 50 | 51 | first_name = models.CharField(max_length=255) 52 | second_name = models.CharField(max_length=255) 53 | ... 54 | 55 | picture = models.ForeignKey(Image) 56 | 57 | 58 | 59 | You can also (obviously) use a ManyToMany field, for example: 60 | 61 | :: 62 | 63 | .... 64 | from django_image_tools.models import Image 65 | 66 | class Slideshow(models.Model): 67 | title = models.CharField(max_length=255) 68 | description = models.TextField() 69 | ... 70 | 71 | slides = models.ManyToManyField(Image) 72 | 73 | 74 | 75 | That's all you need to do when dealing with the models. The next step is creating your custom filters and sizes in the 76 | admin panel. 77 | 78 | For example, here I created a "blurred" filter (Gaussian filter, radius 2) 79 | 80 | 81 | .. image:: /_static/filter_blurred.png 82 | 83 | 84 | a "thumbnail" size.. 85 | 86 | .. image:: /_static/size_thumbnail.png 87 | 88 | Then, in your templates, you can use them like this: 89 | 90 | :: 91 | 92 | # Displaying a thumbnail 93 | 94 | 95 | # Displaying a blurred thumbnail 96 | 97 | 98 | # Displaying the original image 99 | 100 | 101 | # Displaying the blurred (original) image 102 | 103 | 104 | 105 | Including thumbnails in your admin 106 | ---------------------------------- 107 | 108 | You can include thumbnail in your admin panel 109 | 110 | Just look at this admin.py file 111 | 112 | :: 113 | 114 | from __future__ import absolute_import 115 | from django.contrib import admin 116 | from .models import Person 117 | 118 | 119 | class PersonAdmin(admin.ModelAdmin): 120 | list_display = ('thumbnail', 'first_name', 'second_name') 121 | 122 | admin.site.register(Person, PersonAdmin) 123 | 124 | 125 | You will also need to tweak your model so that it uses the ``thumbnail`` method of the correct image. 126 | Here's an example: 127 | 128 | :: 129 | 130 | from django.db import models 131 | from django_image_tools.models import Image 132 | 133 | 134 | class Person(models.Model): 135 | first_name = models.CharField(max_length=255) 136 | second_name = models.CharField(max_length=255) 137 | 138 | picture = models.ForeignKey(Image) 139 | 140 | # Add the thumbnail method and grab the image thumbnail 141 | def thumbnail(self): 142 | return self.picture.thumbnail() 143 | 144 | # Now you only need to tell django that this thumbnail field is safe 145 | thumbnail.allow_tags = True 146 | 147 | 148 | Please note that in this case we used the ``picture.thumbnail()`` method, and not the ``picture.get__thumbnail`` 149 | because this particular method is designed to output the whole 'img' tag for the django admin panel. 150 | 151 | If you have any problem, make sure you followed `Django's guide to serve static and user uploaded files 152 | `_ ! 153 | 154 | -------------------------------------------------------------------------------- /docs/build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({envversion:42,terms:{all:[1,3,5,2],reprocess:4,follow:2,alt:3,row:1,whose:5,decid:5,upload_to:2,sens:5,get__blurred__origin:[5,2],get__blurred__thumbnail:[5,2],everi:5,fall:1,untouch:5,brows:1,tri:5,contenttyp:[],list:[3,5],upload:[1,5,2],readabl:5,"try":5,small:1,dir:1,pleas:2,smaller:5,design:[5,2],even:[5,4],index:0,what:5,sub:[1,2],pinterest:5,current:[3,5],delet:[1,3],version:[1,3,5],blur:[5,2],"new":[5,1,3,4],method:[3,5,2],whatev:[],never:[1,3,4],here:[3,5,2],lack:5,let:[5,2],path:[1,5,2],vertic:5,dry:5,search:[0,1],checksum:[5,4],credit:[3,5],chang:[5,1,4],tweak:[5,2],app:[5,1,4,2],filenam:[3,5],was_upsc:[1,5],suddenli:5,instal:2,from:[5,2],doubl:5,regist:2,next:2,websit:5,readi:5,call:[3,5],until:5,paramet:5,tell:2,more:[],desir:5,peopl:5,notic:5,alt_text:[3,5],flag:[1,5],particular:2,cach:[1,4],fly:4,join:2,sometim:1,setup:3,work:[],remain:5,minimum:2,obvious:[1,5,2],can:[5,1,3,4,2],purpos:5,fetch:1,def:[3,2],process:4,templat:[1,5,2],manytomanyfield:2,tag:[5,2],want:[1,3,5,2],exmapl:5,alwai:1,cours:[5,2],first_nam:2,caption:[3,5],write:5,simpl:[3,5],after:5,befor:5,upscal:[1,5],attempt:5,bind:5,django:[],combin:3,allow:[1,5],enter:5,origin:[1,5,2],becaus:[4,2],jpeg:1,own:5,through:[1,5],bunch:4,img:[5,2],whole:2,raw_id_field:1,might:1,them:[1,3,5,2],good:2,"return":2,thei:[1,2],python:3,auto:5,safe:2,auth:[],now:[5,2],complain:1,bigger:5,somewher:5,name:[3,5],separ:5,easili:3,slide:2,each:5,higher:[1,5],mean:5,replac:[5,1,4],gaussian:[5,2],"static":2,our:3,out:5,variabl:1,assertequ:3,content:0,suitabl:5,correct:2,red:1,lag:4,insid:1,django_suit:1,differ:5,effect:5,believ:5,org:[],md5:[5,4],could:5,keep:5,thing:[3,5],charfield:2,assign:3,first:4,blind:5,media_root:2,number:1,yourself:3,done:5,installed_app:2,given:5,get__:5,script:3,teardown:3,top:5,system:[1,4],messag:[],max_length:2,too:[1,3],"final":[],store:2,option:5,travi:3,tool:[],adject:5,textfield:2,than:5,serv:2,remov:1,horizont:5,get__thumbnail:[5,2],were:1,posit:5,sai:[5,2],ani:2,donkei:3,have:[5,3,4,2],need:[5,2],advic:[1,5],self:[3,2],note:[5,2],also:[5,1,3,4,2],which:[1,5,2],noth:5,sure:2,pain:3,though:1,object:3,"class":2,don:4,doc:5,request:[5,1,4],dummi:3,test_imag:3,runtim:5,text:3,radiu:2,session:[],permiss:1,find:[3,5],onli:[5,4,2],ratio:5,menu:1,activ:5,should:[5,4,2],folder:[1,2],variou:4,get:5,delete_imag:3,some_imag:5,cannot:5,requir:[3,2],integr:[3,5],contain:[5,2],grab:2,view:5,set:[1,2],see:[1,3,5],mandatori:5,result:[1,5],seo:5,subject:5,detect:4,correctli:[],databas:[3,5],figur:5,"import":[3,5,2],experi:4,thumbnail:[1,5],modeladmin:2,attribut:5,popup:1,kei:[3,5],create_dummy_imag:3,cut:5,django_image_tools_cache_dir:1,both:5,admin:[1,5],foreign:[3,5],etc:5,cola:3,mani:5,login:[],com:[],point:5,height:5,non:1,guid:2,duplic:1,coupl:2,subfold:2,imag:[],resolut:5,great:5,those:5,"case":2,look:[5,2],defin:5,coca:3,error:1,exist:[5,2],almost:5,site:2,worri:4,subject_vertical_posit:5,itself:5,partner:3,sever:3,media:[1,2],make:[3,5,2],same:5,bonsaistudio:[],complet:3,http:[],ness:5,temporari:2,user:[5,1,4,2],improv:5,kid:3,center:5,entri:3,well:1,person:2,exampl:5,thi:[5,1,3,4,2],everyth:[],left:5,clog:4,just:[3,5,2],absolute_import:2,aspect:5,touch:1,previous:1,project_root:2,partnerimag:3,except:5,add:[5,2],board:5,appli:5,input:[1,5],save:[3,5],modul:0,match:5,real:3,hover:5,around:5,mayb:5,read:5,howto:[],intuit:5,know:[1,5],background:1,like:2,specif:5,server:4,avatar:2,output:[5,2],resiz:5,list_displai:2,page:[0,3],right:[1,5],often:3,deal:2,get__origin:[1,2],some:[5,4],back:1,django_image_tool:[3,5,2],allow_tag:2,unless:[1,4],scale:1,djangoproject:[],personadmin:2,notabl:4,step:2,"throw":5,panel:[1,5,2],src:[5,2],about:4,actual:5,model_with_imag:3,"__future__":2,bound:5,automat:[1,5],down:5,contrib:2,subject_horizontal_posit:5,wai:4,pictur:2,submit:1,custom:[5,2],avail:[1,5],width:5,forc:5,renam:[1,5],"true":2,esqu:5,made:3,possibl:5,displai:[1,5,2],manytomani:2,foreignkei:2,otherwis:1,problem:2,second_nam:2,creat:[5,3,4,2],pic:2,doesn:[1,5],strongli:1,decreas:1,file:[5,2],pip:2,check:[5,4],fill:4,testinsert:3,titl:[3,5,2],when:[5,2],field:[1,5,2],other:4,futur:1,rememb:3,you:[5,1,3,4,2],nice:1,bottom:5,slideshow:2,"250x250":5,descript:2,time:[5,3,4],profil:2},objtypes:{},objnames:{},filenames:["index","more_features","quickstart","testing","how_works","how_to_use"],titles:["Welcome to Django Image Tools’s documentation!","More features","Quick Start","Testing","How it works","How to use it"],objects:{},titleterms:{featur:1,crop:5,syntax:5,tabl:0,your:[5,2],size:5,welcom:0,how:[5,4],support:3,configur:2,start:2,includ:[5,2],test:3,document:0,thumbnail:2,more:1,tool:0,indic:0,philosophi:5,imag:0,admin:2,work:4,django:0,filter:5,exampl:2,quick:2,model:[5,2]}}) -------------------------------------------------------------------------------- /docs/build/html/how_works.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | How it works — Django Image Tools 0.7.b1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |
53 |

How it works

54 |

The app only creates the image the first time it is requested. So don’t worry about the system clogging 55 | because you have 10.0000 images and you create a new size on the fly, or having your server filled up with cached 56 | images that are never used. 57 | The images are also cached, so you should never experience a notable lag, unless you request a bunch of images 58 | of a size that was never processed. 59 | The app uses an md5 checksum to check if the image was changed. This way, it can detect even if the image was 60 | replaced by some other app, (or the user) and reprocess the various sizes of that image on request.

61 |
62 | 63 | 64 |
65 |
66 |
67 |
68 |
69 |

Previous topic

70 |

How to use it

72 |

Next topic

73 |

More features

75 |

This Page

76 | 80 | 92 | 93 |
94 |
95 |
96 |
97 | 112 | 116 | 117 | -------------------------------------------------------------------------------- /docs/source/quickstart.rst: -------------------------------------------------------------------------------- 1 | Quick Start 2 | =========== 3 | 4 | All you have to do is 5 | 6 | :: 7 | 8 | pip install django-image-tools-2 9 | 10 | and of course, add the app in your INSTALLED_APPS as 11 | 12 | :: 13 | 14 | INSTALLED_APPS = ( 15 | ... 16 | 'django_image_tools', 17 | ... 18 | ) 19 | 20 | Configuration 21 | ------------- 22 | 23 | The minimum required settings you should add in your settings.py are: 24 | 25 | :: 26 | 27 | # Folder in which you want to store your images, in this example it's the sub folder 'media' 28 | MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media') 29 | # Temporary folder for upload, in this example is the subfolder 'upload' 30 | UPLOAD_TO = os.path.join(PROJECT_ROOT, 'media/upload') 31 | 32 | The folders will be created if they do not exist. 33 | 34 | You should also add your filters and sizes in your settings file, like this: 35 | 36 | :: 37 | 38 | DJANGO_IMAGE_TOOLS_SIZES = { 39 | 'thumbnail': { 40 | 'width': 30, 41 | 'height': 30, 42 | 'auto': None 43 | }, 44 | 'very_long': { 45 | 'width': 200, 46 | 'height': 30, 47 | 'auto': None 48 | }, 49 | 'very_tall': { 50 | 'width': 30, 51 | 'height': 200, 52 | 'auto': None 53 | }, 54 | 'huge': { 55 | 'width': 2000, 56 | 'height': 2000, 57 | 'auto': None 58 | }, 59 | 'auto_width': { 60 | 'width': 0, 61 | 'height': 20, 62 | 'auto': 'WIDTH' 63 | }, 64 | 'auto_height': { 65 | 'width': 20, 66 | 'height': 0, 67 | 'auto': 'HEIGHT' 68 | }, 69 | } 70 | 71 | DJANGO_IMAGE_TOOLS_FILTERS = { 72 | 'grey_scaled': { 73 | 'filter_type': 'GREYSCALE' 74 | }, 75 | 'blurred': { 76 | 'filter_type': 'GAUSSIAN_BLUR', 77 | 'value': 5 78 | } 79 | } 80 | 81 | 82 | That's it, you're good to go now. 83 | Let's create a couple of models containing images! 84 | 85 | 86 | Example models 87 | -------------- 88 | 89 | Let's say you have a "Person" model and you want to include an Avatar, or a profile pic. Here's how you do it 90 | 91 | :: 92 | 93 | .... 94 | from django_image_tools.models import Image 95 | 96 | class Person(models.Model): 97 | 98 | first_name = models.CharField(max_length=255) 99 | second_name = models.CharField(max_length=255) 100 | ... 101 | 102 | picture = models.ForeignKey(Image) 103 | 104 | 105 | 106 | You can also (obviously) use a ManyToMany field, for example: 107 | 108 | :: 109 | 110 | .... 111 | from django_image_tools.models import Image 112 | 113 | class Slideshow(models.Model): 114 | title = models.CharField(max_length=255) 115 | description = models.TextField() 116 | ... 117 | 118 | slides = models.ManyToManyField(Image) 119 | 120 | 121 | 122 | That's all you need to do when dealing with the models. 123 | 124 | Then, in your templates, you can use them like this: 125 | 126 | :: 127 | 128 | # Displaying a thumbnail 129 | 130 | 131 | # Displaying a blurred thumbnail 132 | 133 | 134 | # Displaying the original image 135 | 136 | 137 | # Displaying the blurred (original) image 138 | 139 | 140 | 141 | Including thumbnails in your admin 142 | ---------------------------------- 143 | 144 | You can include thumbnail in your admin panel 145 | 146 | Just look at this admin.py file 147 | 148 | :: 149 | 150 | from __future__ import absolute_import 151 | from django.contrib import admin 152 | from .models import Person 153 | 154 | 155 | class PersonAdmin(admin.ModelAdmin): 156 | list_display = ('thumbnail', 'first_name', 'second_name') 157 | 158 | admin.site.register(Person, PersonAdmin) 159 | 160 | 161 | You will also need to tweak your model so that it uses the ``thumbnail`` method of the correct image. 162 | Here's an example: 163 | 164 | :: 165 | 166 | from django.db import models 167 | from django_image_tools.models import Image 168 | 169 | 170 | class Person(models.Model): 171 | first_name = models.CharField(max_length=255) 172 | second_name = models.CharField(max_length=255) 173 | 174 | picture = models.ForeignKey(Image) 175 | 176 | # Add the thumbnail method and grab the image thumbnail 177 | def thumbnail(self): 178 | return self.picture.thumbnail() 179 | 180 | # Now you only need to tell django that this thumbnail field is safe 181 | thumbnail.allow_tags = True 182 | 183 | 184 | Please note that in this case we used the ``picture.thumbnail()`` method, and not the ``picture.get__thumbnail`` 185 | because this particular method is designed to output the whole 'img' tag for the django admin panel. 186 | 187 | If you have any problem, make sure you followed `Django's guide to serve static and user uploaded files 188 | `_ ! 189 | 190 | -------------------------------------------------------------------------------- /docs/build/html/_static/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | * default.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- default theme. 6 | * 7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #133f52; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | tt { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning tt { 241 | background: #efc2c2; 242 | } 243 | 244 | .note tt { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } -------------------------------------------------------------------------------- /docs/build/html/_static/sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * sidebar.js 3 | * ~~~~~~~~~~ 4 | * 5 | * This script makes the Sphinx sidebar collapsible. 6 | * 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton 9 | * used to collapse and expand the sidebar. 10 | * 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden 12 | * and the width of the sidebar and the margin-left of the document 13 | * are decreased. When the sidebar is expanded the opposite happens. 14 | * This script saves a per-browser/per-session cookie used to 15 | * remember the position of the sidebar among the pages. 16 | * Once the browser is closed the cookie is deleted and the position 17 | * reset to the default (expanded). 18 | * 19 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 20 | * :license: BSD, see LICENSE for details. 21 | * 22 | */ 23 | 24 | $(function() { 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | // global elements used by the functions. 34 | // the 'sidebarbutton' element is defined as global after its 35 | // creation, in the add_sidebar_button function 36 | var bodywrapper = $('.bodywrapper'); 37 | var sidebar = $('.sphinxsidebar'); 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); 39 | 40 | // for some reason, the document has no sidebar; do not run into errors 41 | if (!sidebar.length) return; 42 | 43 | // original margin-left of the bodywrapper and width of the sidebar 44 | // with the sidebar expanded 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); 46 | var ssb_width_expanded = sidebar.width(); 47 | 48 | // margin-left of the bodywrapper and width of the sidebar 49 | // with the sidebar collapsed 50 | var bw_margin_collapsed = '.8em'; 51 | var ssb_width_collapsed = '.8em'; 52 | 53 | // colors used by the current theme 54 | var dark_color = $('.related').css('background-color'); 55 | var light_color = $('.document').css('background-color'); 56 | 57 | function sidebar_is_collapsed() { 58 | return sidebarwrapper.is(':not(:visible)'); 59 | } 60 | 61 | function toggle_sidebar() { 62 | if (sidebar_is_collapsed()) 63 | expand_sidebar(); 64 | else 65 | collapse_sidebar(); 66 | } 67 | 68 | function collapse_sidebar() { 69 | sidebarwrapper.hide(); 70 | sidebar.css('width', ssb_width_collapsed); 71 | bodywrapper.css('margin-left', bw_margin_collapsed); 72 | sidebarbutton.css({ 73 | 'margin-left': '0', 74 | 'height': bodywrapper.height() 75 | }); 76 | sidebarbutton.find('span').text('»'); 77 | sidebarbutton.attr('title', _('Expand sidebar')); 78 | document.cookie = 'sidebar=collapsed'; 79 | } 80 | 81 | function expand_sidebar() { 82 | bodywrapper.css('margin-left', bw_margin_expanded); 83 | sidebar.css('width', ssb_width_expanded); 84 | sidebarwrapper.show(); 85 | sidebarbutton.css({ 86 | 'margin-left': ssb_width_expanded-12, 87 | 'height': bodywrapper.height() 88 | }); 89 | sidebarbutton.find('span').text('«'); 90 | sidebarbutton.attr('title', _('Collapse sidebar')); 91 | document.cookie = 'sidebar=expanded'; 92 | } 93 | 94 | function add_sidebar_button() { 95 | sidebarwrapper.css({ 96 | 'float': 'left', 97 | 'margin-right': '0', 98 | 'width': ssb_width_expanded - 28 99 | }); 100 | // create the button 101 | sidebar.append( 102 | '
«
' 103 | ); 104 | var sidebarbutton = $('#sidebarbutton'); 105 | light_color = sidebarbutton.css('background-color'); 106 | // find the height of the viewport to center the '<<' in the page 107 | var viewport_height; 108 | if (window.innerHeight) 109 | viewport_height = window.innerHeight; 110 | else 111 | viewport_height = $(window).height(); 112 | sidebarbutton.find('span').css({ 113 | 'display': 'block', 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 115 | }); 116 | 117 | sidebarbutton.click(toggle_sidebar); 118 | sidebarbutton.attr('title', _('Collapse sidebar')); 119 | sidebarbutton.css({ 120 | 'color': '#FFFFFF', 121 | 'border-left': '1px solid ' + dark_color, 122 | 'font-size': '1.2em', 123 | 'cursor': 'pointer', 124 | 'height': bodywrapper.height(), 125 | 'padding-top': '1px', 126 | 'margin-left': ssb_width_expanded - 12 127 | }); 128 | 129 | sidebarbutton.hover( 130 | function () { 131 | $(this).css('background-color', dark_color); 132 | }, 133 | function () { 134 | $(this).css('background-color', light_color); 135 | } 136 | ); 137 | } 138 | 139 | function set_position_from_cookie() { 140 | if (!document.cookie) 141 | return; 142 | var items = document.cookie.split(';'); 143 | for(var k=0; k 47 | 48 | To improve readability of your templates, we advice you to name the filters as adjectives. 49 | For example, a Gaussian Blur could be called 'blurred'. 50 | 51 | If you want to have a thumbnail with your Gaussian blur, now the template reads: 52 | 53 | :: 54 | 55 | 56 | 57 | How intuitive is that? 58 | Note that filters and sizes are separated by a double '_', as django-esque as possible. 59 | 60 | Obviously, you cannot add filters / sizes whose name contains a double '_'. 61 | 62 | 63 | Size & Cropping 64 | --------------- 65 | 66 | You will find in the admin panel the 'django_image_tools' option. You can enter all the sizes 67 | you're going to use in your website there. 68 | The options for each size are: 69 | 70 | - Name 71 | - Width (auto) 72 | - Height (auto) 73 | 74 | All of the sizes you create will be available for the images the user will upload through its name. 75 | For example, you can have a 'thumbnail' 250x250 size, and every image you upload will have the ``get__thumbnail`` 76 | method that will output the path for the image with the requested size. 77 | 78 | Having 'auto' height, for exmaple, means that the image will be resized to match the given width, and keep the original 79 | aspect ratio (This is useful for example, if you want to create a *pinterest* board). 80 | 81 | Of course, you can only have auto height or auto width, but not both. 82 | 83 | In the template, to display an image field, all you have to do is: 84 | 85 | :: 86 | 87 | 88 | 89 | 90 | Here's a list of all the fields for each image: 91 | 92 | - checksum 93 | A md5 checksum of the image. Useful for checking the integrity of the files with the database. 94 | - filename 95 | The current file name. Changing this will result in renaming the actual file (useful for SEO purposes). 96 | 97 | **Attempting to rename with the name of an existing file will throw an exception** 98 | 99 | - subject_horizontal_position 100 | The horizontal position of the subject. This is currently one of the list 101 | (left, 1/3, center, 2/3, right). 102 | - subject_vertical_position 103 | The vertical position of the subject. This is currently one of the list 104 | (top, 1/3, center, 2/3, bottom). 105 | 106 | **If the aspect ratio of the resized image doesn't match the original ratio, 107 | the image will be cropped around this point** 108 | 109 | - was_upscaled 110 | Flag that notices if the image was used somewhere with a size 111 | bigger than its own (resulting in an upscaling). Useful for letting the user know that it 112 | should replace this image with a higher-resolution version. 113 | - title 114 | A title field for the image 115 | - caption 116 | Caption of the image 117 | - alt_text 118 | For blind people and SEO 119 | - credit 120 | Credit field 121 | 122 | 123 | Filters 124 | ------- 125 | 126 | Django Image tools also works great for applying filters to your images. 127 | To define a filter, just add it in the admin panel, and tweak it with its parameters until you get the desired effect. 128 | 129 | For example, let's say you defined a filter named 'blurred' with a Gaussian Blur and you want 130 | a blurred thumbnail of your image. 131 | This should be the image tag. 132 | 133 | :: 134 | 135 | 136 | 137 | 138 | **Note** that when using a filter, the image size is mandatory. If you want to apply a filter to an image with its 139 | original size, use 'original' as size 140 | 141 | :: 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /docs/build/html/more_features.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | More features — Django Image Tools 0.7.b1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 46 | 47 |
48 |
49 |
50 |
51 | 52 |
53 |

More features

54 |

The images will all be available in the admin panel. You can browse and search through all of them. 55 | Sometimes, the users will upload a ‘small’ image (You know users right?) and then they’ll complain that the image 56 | doesn’t scale well, or it’s too jpegged. 57 | The app will automatically flag all images for which an upscaled version was requested, by flagging them with the 58 | ‘was_upscaled’ flag (if you’re using django_suit, the background of the row will also be displayed red). You can use the filter in the app to see which one were upscaled, and delete them, or replace them with a higher-res version. 59 | The original images will never be touched, unless the user wants to rename them. 60 | The cached image folder can be changed in the system settings, through the settings variable 61 | ‘DJANGO_IMAGE_TOOLS_CACHE_DIR’. This will always be a sub dir of the ‘MEDIA’ dir, though I might change this 62 | in the future. 63 | I strongly advice you to use the ‘raw_id_fields’ for the image fields, as it will allow the user to search for a 64 | previously submitted image or input a new one with a nice popup menu. This will decrease the number of duplicates. 65 | I also strongly advice you to remove permission for non admin users for the ‘size’ app, as removing a size that is 66 | used inside a template will result (obviously) in a 500 error. 67 | If there is a ‘thumbnail’ size, the app will display images of that size for the admin panel, otherwise it will fall 68 | back on the original. 69 | You can fetch the original image path by requesting ‘image.get__original’.

70 |
71 | 72 | 73 |
74 |
75 |
76 |
77 |
78 |

Previous topic

79 |

How it works

81 |

Next topic

82 |

Testing

84 |

This Page

85 | 89 | 101 | 102 |
103 |
104 |
105 |
106 | 121 | 125 | 126 | -------------------------------------------------------------------------------- /htmlcov/style.css: -------------------------------------------------------------------------------- 1 | /* CSS styles for Coverage. */ 2 | /* Page-wide styles */ 3 | html, body, h1, h2, h3, p, td, th { 4 | margin: 0; 5 | padding: 0; 6 | border: 0; 7 | outline: 0; 8 | font-weight: inherit; 9 | font-style: inherit; 10 | font-size: 100%; 11 | font-family: inherit; 12 | vertical-align: baseline; 13 | } 14 | 15 | /* Set baseline grid to 16 pt. */ 16 | body { 17 | font-family: georgia, serif; 18 | font-size: 1em; 19 | } 20 | 21 | html>body { 22 | font-size: 16px; 23 | } 24 | 25 | /* Set base font size to 12/16 */ 26 | p { 27 | font-size: .75em; /* 12/16 */ 28 | line-height: 1.33333333em; /* 16/12 */ 29 | } 30 | 31 | table { 32 | border-collapse: collapse; 33 | } 34 | 35 | a.nav { 36 | text-decoration: none; 37 | color: inherit; 38 | } 39 | a.nav:hover { 40 | text-decoration: underline; 41 | color: inherit; 42 | } 43 | 44 | /* Page structure */ 45 | #header { 46 | background: #f8f8f8; 47 | width: 100%; 48 | border-bottom: 1px solid #eee; 49 | } 50 | 51 | #source { 52 | padding: 1em; 53 | font-family: "courier new", monospace; 54 | } 55 | 56 | #indexfile #footer { 57 | margin: 1em 3em; 58 | } 59 | 60 | #pyfile #footer { 61 | margin: 1em 1em; 62 | } 63 | 64 | #footer .content { 65 | padding: 0; 66 | font-size: 85%; 67 | font-family: verdana, sans-serif; 68 | color: #666666; 69 | font-style: italic; 70 | } 71 | 72 | #index { 73 | margin: 1em 0 0 3em; 74 | } 75 | 76 | /* Header styles */ 77 | #header .content { 78 | padding: 1em 3em; 79 | } 80 | 81 | h1 { 82 | font-size: 1.25em; 83 | } 84 | 85 | h2.stats { 86 | margin-top: .5em; 87 | font-size: 1em; 88 | } 89 | .stats span { 90 | border: 1px solid; 91 | padding: .1em .25em; 92 | margin: 0 .1em; 93 | cursor: pointer; 94 | border-color: #999 #ccc #ccc #999; 95 | } 96 | .stats span.hide_run, .stats span.hide_exc, 97 | .stats span.hide_mis, .stats span.hide_par, 98 | .stats span.par.hide_run.hide_par { 99 | border-color: #ccc #999 #999 #ccc; 100 | } 101 | .stats span.par.hide_run { 102 | border-color: #999 #ccc #ccc #999; 103 | } 104 | 105 | .stats span.run { 106 | background: #ddffdd; 107 | } 108 | .stats span.exc { 109 | background: #eeeeee; 110 | } 111 | .stats span.mis { 112 | background: #ffdddd; 113 | } 114 | .stats span.hide_run { 115 | background: #eeffee; 116 | } 117 | .stats span.hide_exc { 118 | background: #f5f5f5; 119 | } 120 | .stats span.hide_mis { 121 | background: #ffeeee; 122 | } 123 | .stats span.par { 124 | background: #ffffaa; 125 | } 126 | .stats span.hide_par { 127 | background: #ffffcc; 128 | } 129 | 130 | /* Help panel */ 131 | #keyboard_icon { 132 | float: right; 133 | cursor: pointer; 134 | } 135 | 136 | .help_panel { 137 | position: absolute; 138 | background: #ffc; 139 | padding: .5em; 140 | border: 1px solid #883; 141 | display: none; 142 | } 143 | 144 | #indexfile .help_panel { 145 | width: 20em; height: 4em; 146 | } 147 | 148 | #pyfile .help_panel { 149 | width: 16em; height: 8em; 150 | } 151 | 152 | .help_panel .legend { 153 | font-style: italic; 154 | margin-bottom: 1em; 155 | } 156 | 157 | #panel_icon { 158 | float: right; 159 | cursor: pointer; 160 | } 161 | 162 | .keyhelp { 163 | margin: .75em; 164 | } 165 | 166 | .keyhelp .key { 167 | border: 1px solid black; 168 | border-color: #888 #333 #333 #888; 169 | padding: .1em .35em; 170 | font-family: monospace; 171 | font-weight: bold; 172 | background: #eee; 173 | } 174 | 175 | /* Source file styles */ 176 | .linenos p { 177 | text-align: right; 178 | margin: 0; 179 | padding: 0 .5em; 180 | color: #999999; 181 | font-family: verdana, sans-serif; 182 | font-size: .625em; /* 10/16 */ 183 | line-height: 1.6em; /* 16/10 */ 184 | } 185 | .linenos p.highlight { 186 | background: #ffdd00; 187 | } 188 | .linenos p a { 189 | text-decoration: none; 190 | color: #999999; 191 | } 192 | .linenos p a:hover { 193 | text-decoration: underline; 194 | color: #999999; 195 | } 196 | 197 | td.text { 198 | width: 100%; 199 | } 200 | .text p { 201 | margin: 0; 202 | padding: 0 0 0 .5em; 203 | border-left: 2px solid #ffffff; 204 | white-space: nowrap; 205 | } 206 | 207 | .text p.mis { 208 | background: #ffdddd; 209 | border-left: 2px solid #ff0000; 210 | } 211 | .text p.run, .text p.run.hide_par { 212 | background: #ddffdd; 213 | border-left: 2px solid #00ff00; 214 | } 215 | .text p.exc { 216 | background: #eeeeee; 217 | border-left: 2px solid #808080; 218 | } 219 | .text p.par, .text p.par.hide_run { 220 | background: #ffffaa; 221 | border-left: 2px solid #eeee99; 222 | } 223 | .text p.hide_run, .text p.hide_exc, .text p.hide_mis, .text p.hide_par, 224 | .text p.hide_run.hide_par { 225 | background: inherit; 226 | } 227 | 228 | .text span.annotate { 229 | font-family: georgia; 230 | font-style: italic; 231 | color: #666; 232 | float: right; 233 | padding-right: .5em; 234 | } 235 | .text p.hide_par span.annotate { 236 | display: none; 237 | } 238 | 239 | /* Syntax coloring */ 240 | .text .com { 241 | color: green; 242 | font-style: italic; 243 | line-height: 1px; 244 | } 245 | .text .key { 246 | font-weight: bold; 247 | line-height: 1px; 248 | } 249 | .text .str { 250 | color: #000080; 251 | } 252 | 253 | /* index styles */ 254 | #index td, #index th { 255 | text-align: right; 256 | width: 5em; 257 | padding: .25em .5em; 258 | border-bottom: 1px solid #eee; 259 | } 260 | #index th { 261 | font-style: italic; 262 | color: #333; 263 | border-bottom: 1px solid #ccc; 264 | cursor: pointer; 265 | } 266 | #index th:hover { 267 | background: #eee; 268 | border-bottom: 1px solid #999; 269 | } 270 | #index td.left, #index th.left { 271 | padding-left: 0; 272 | } 273 | #index td.right, #index th.right { 274 | padding-right: 0; 275 | } 276 | #index th.headerSortDown, #index th.headerSortUp { 277 | border-bottom: 1px solid #000; 278 | } 279 | #index td.name, #index th.name { 280 | text-align: left; 281 | width: auto; 282 | } 283 | #index td.name a { 284 | text-decoration: none; 285 | color: #000; 286 | } 287 | #index td.name a:hover { 288 | text-decoration: underline; 289 | color: #000; 290 | } 291 | #index tr.total { 292 | } 293 | #index tr.total td { 294 | font-weight: bold; 295 | border-top: 1px solid #ccc; 296 | border-bottom: none; 297 | } 298 | #index tr.file:hover { 299 | background: #eeeeee; 300 | } 301 | -------------------------------------------------------------------------------- /docs/source/how_to_use.rst: -------------------------------------------------------------------------------- 1 | How to use it 2 | ============= 3 | 4 | Philosophy 5 | ---------- 6 | 7 | There are many tools suitable for cutting, cropping, resizing and applying filters at runtime. 8 | but we noticed that many of these lacked a sense of 'DRY-ness' 9 | as almost all of them forced you to input the size and the filter options in the template itself. 10 | 11 | Now, try to see this from a designer point of view. As a designer, I want all of the images in this template to have a 12 | specific effect, and maybe I want a different effect for the hover version. So what do I do? Do I write down the 13 | effect's parameters for each image in the template? 14 | 15 | And what if I wanted to change the effect after the template is ready? 16 | 17 | The same thing applies for image sizes, what if you suddenly needed your images to be bigger or smaller? 18 | 19 | Django Image Tools allows you to create specific filters and sizes for your images, and bind those filters to 20 | your images through their name, so you can change the filter parameters and the image size from your settings file, 21 | and those changes will automatically be applied to all of the bound images in your templates. Now your templates 22 | will remain untouched even if you decide to change a filter, or even the size of your images. 23 | 24 | We believe this will save some time looking at the docs of an app trying to figure out which custom filter file you 25 | should include, how to input your parameters, etc... 26 | 27 | 28 | Include it in your models 29 | ------------------------- 30 | 31 | Nothing more simple. Just import the 'Image' model in your models.py file and create a Foreign Key to it. Done! 32 | 33 | Syntax 34 | ------ 35 | 36 | We tried to make the syntax as readable and intuitive as possible. 37 | Filter names should be applied before size names. Size names are mandatory. 38 | 39 | To activate django_image_tools, you need to call a ``get__`` attribute on the image. 40 | 41 | For example, if you want the path for a size named 'thumbnail', you should define a new Size called 'thumbnail' on 42 | your settings file. Then, in your templates you should use: 43 | 44 | :: 45 | 46 | 47 | 48 | To improve readability of your templates, we advice you to name the filters as adjectives. 49 | For example, a Gaussian Blur could be called 'blurred'. 50 | 51 | If you want to have a thumbnail with your Gaussian blur, now the template reads: 52 | 53 | :: 54 | 55 | 56 | 57 | How intuitive is that? 58 | Note that filters and sizes are separated by a double '_', as django-esque as possible. 59 | 60 | Obviously, you cannot add filters / sizes whose name contains a double '_'. 61 | 62 | 63 | Size & Cropping 64 | --------------- 65 | 66 | Sizes and filters are defined in your settings file. Previous versions of this app had them defined into the admin 67 | panel, but we soon discovered how this was a real pain, especially when trying to work on multiple environments. 68 | 69 | Here is a simple settings definition: 70 | 71 | ``` 72 | 73 | DJANGO_IMAGE_TOOLS_SIZES = { 74 | 'thumbnail': { 75 | 'width': 30, 76 | 'height': 30, 77 | 'auto': None 78 | }, 79 | 'very_long': { 80 | 'width': 200, 81 | 'height': 30, 82 | 'auto': None 83 | }, 84 | 'very_tall': { 85 | 'width': 30, 86 | 'height': 200, 87 | 'auto': None 88 | }, 89 | 'huge': { 90 | 'width': 2000, 91 | 'height': 2000, 92 | 'auto': None 93 | }, 94 | 'auto_width': { 95 | 'width': 0, 96 | 'height': 20, 97 | 'auto': 'WIDTH' 98 | }, 99 | 'auto_height': { 100 | 'width': 20, 101 | 'height': 0, 102 | 'auto': 'HEIGHT' 103 | }, 104 | } 105 | 106 | ``` 107 | 108 | All of the sizes you create will be available for the images the user will upload through their name. 109 | For example, you can have a 'thumbnail' 250x250 size, and every image you upload will have the ``get__thumbnail`` 110 | method that will output the path for the image with the requested size. 111 | 112 | Having 'auto' height, for exmaple, means that the image will be resized to match the given width, and keep the original 113 | aspect ratio (This is useful for example, if you want to create a *pinterest* board). 114 | The 'auto' attribute can be either None (or just not defined), 'WIDTH', or 'HEIGHT'. 115 | 116 | In the template, to display an image field, all you have to do is: 117 | 118 | :: 119 | 120 | 121 | 122 | 123 | Here's a list of all the fields for each image: 124 | 125 | - checksum 126 | A md5 checksum of the image. Useful for checking the integrity of the files with the database. 127 | - filename 128 | The current file name. Changing this will result in renaming the actual file (useful for SEO purposes). 129 | 130 | **Attempting to rename with the name of an existing file will throw an exception** 131 | 132 | - subject_horizontal_position 133 | The horizontal position of the subject. This is currently one of the list 134 | (left, 1/3, center, 2/3, right). 135 | - subject_vertical_position 136 | The vertical position of the subject. This is currently one of the list 137 | (top, 1/3, center, 2/3, bottom). 138 | 139 | **If the aspect ratio of the resized image doesn't match the original ratio, 140 | the image will be cropped around this point** 141 | 142 | - was_upscaled 143 | Flag that notices if the image was used somewhere with a size 144 | bigger than its own (resulting in an upscaling). Useful for letting the user know that it 145 | should replace this image with a higher-resolution version. 146 | - title 147 | A title field for the image 148 | - caption 149 | Caption of the image 150 | - alt_text 151 | For blind people and SEO 152 | - credit 153 | Credit field 154 | 155 | 156 | Filters 157 | ------- 158 | 159 | Django Image tools also works great for applying filters to your images. 160 | To define a filter, just add it in your settings file. Here's an example. 161 | 162 | ``` 163 | DJANGO_IMAGE_TOOLS_FILTERS = { 164 | 'grey_scaled': { 165 | 'filter_type': 'GREYSCALE' 166 | }, 167 | 'blurred': { 168 | 'filter_type': 'GAUSSIAN_BLUR', 169 | 'value': 5 170 | } 171 | } 172 | ``` 173 | 174 | For example, let's say you defined a filter named 'blurred' with a Gaussian Blur and you want 175 | a blurred thumbnail of your image. 176 | This should be the image tag. 177 | 178 | Currently these are the only two filters available, we will add them if the projects becomes more popular and / or we'll 179 | need them. 180 | 181 | :: 182 | 183 | 184 | 185 | 186 | **Note** that when using a filter, the image size is mandatory. If you want to apply a filter to an image with its 187 | original size, use 'original' as size 188 | 189 | :: 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/build/html/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Welcome to Django Image Tools’s documentation! — Django Image Tools 0.7.b1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 |

Welcome to Django Image Tools’s documentation!

50 | https://travis-ci.org/bonsaistudio/django-image-tools.svg?branch=master 51 | https://pypip.in/version/django-image-tools/badge.png 52 | https://pypip.in/license/django-image-tools/badge.png 53 | https://pypip.in/download/django-image-tools/badge.png 54 | https://coveralls.io/repos/bonsaistudio/django-image-tools/badge.png 55 | _images/django-image-tools-icon.png 56 |

Contents:

57 |
58 | 80 |
81 |
82 |
83 |

Indices and tables

84 | 89 |
90 | 91 | 92 |
93 |
94 |
95 |
96 |
97 |

Table Of Contents

98 | 102 | 103 |

Next topic

104 |

Quick Start

106 |

This Page

107 | 111 | 123 | 124 |
125 |
126 |
127 |
128 | 140 | 144 | 145 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/DjangoImageTools.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/DjangoImageTools.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/DjangoImageTools" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/DjangoImageTools" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /docs/build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s == 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node) { 70 | if (node.nodeType == 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span = document.createElement("span"); 75 | span.className = className; 76 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 78 | document.createTextNode(val.substr(pos + text.length)), 79 | node.nextSibling)); 80 | node.nodeValue = val.substr(0, pos); 81 | } 82 | } 83 | else if (!jQuery(node).is("button, select, textarea")) { 84 | jQuery.each(node.childNodes, function() { 85 | highlight(this); 86 | }); 87 | } 88 | } 89 | return this.each(function() { 90 | highlight(this); 91 | }); 92 | }; 93 | 94 | /** 95 | * Small JavaScript module for the documentation. 96 | */ 97 | var Documentation = { 98 | 99 | init : function() { 100 | this.fixFirefoxAnchorBug(); 101 | this.highlightSearchWords(); 102 | this.initIndexTable(); 103 | }, 104 | 105 | /** 106 | * i18n support 107 | */ 108 | TRANSLATIONS : {}, 109 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, 110 | LOCALE : 'unknown', 111 | 112 | // gettext and ngettext don't access this so that the functions 113 | // can safely bound to a different name (_ = Documentation.gettext) 114 | gettext : function(string) { 115 | var translated = Documentation.TRANSLATIONS[string]; 116 | if (typeof translated == 'undefined') 117 | return string; 118 | return (typeof translated == 'string') ? translated : translated[0]; 119 | }, 120 | 121 | ngettext : function(singular, plural, n) { 122 | var translated = Documentation.TRANSLATIONS[singular]; 123 | if (typeof translated == 'undefined') 124 | return (n == 1) ? singular : plural; 125 | return translated[Documentation.PLURALEXPR(n)]; 126 | }, 127 | 128 | addTranslations : function(catalog) { 129 | for (var key in catalog.messages) 130 | this.TRANSLATIONS[key] = catalog.messages[key]; 131 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 132 | this.LOCALE = catalog.locale; 133 | }, 134 | 135 | /** 136 | * add context elements like header anchor links 137 | */ 138 | addContextElements : function() { 139 | $('div[id] > :header:first').each(function() { 140 | $('\u00B6'). 141 | attr('href', '#' + this.id). 142 | attr('title', _('Permalink to this headline')). 143 | appendTo(this); 144 | }); 145 | $('dt[id]').each(function() { 146 | $('\u00B6'). 147 | attr('href', '#' + this.id). 148 | attr('title', _('Permalink to this definition')). 149 | appendTo(this); 150 | }); 151 | }, 152 | 153 | /** 154 | * workaround a firefox stupidity 155 | */ 156 | fixFirefoxAnchorBug : function() { 157 | if (document.location.hash && $.browser.mozilla) 158 | window.setTimeout(function() { 159 | document.location.href += ''; 160 | }, 10); 161 | }, 162 | 163 | /** 164 | * highlight the search words provided in the url in the text 165 | */ 166 | highlightSearchWords : function() { 167 | var params = $.getQueryParameters(); 168 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 169 | if (terms.length) { 170 | var body = $('div.body'); 171 | if (!body.length) { 172 | body = $('body'); 173 | } 174 | window.setTimeout(function() { 175 | $.each(terms, function() { 176 | body.highlightText(this.toLowerCase(), 'highlighted'); 177 | }); 178 | }, 10); 179 | $('') 181 | .appendTo($('#searchbox')); 182 | } 183 | }, 184 | 185 | /** 186 | * init the domain index toggle buttons 187 | */ 188 | initIndexTable : function() { 189 | var togglers = $('img.toggler').click(function() { 190 | var src = $(this).attr('src'); 191 | var idnum = $(this).attr('id').substr(7); 192 | $('tr.cg-' + idnum).toggle(); 193 | if (src.substr(-9) == 'minus.png') 194 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 195 | else 196 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 197 | }).css('display', ''); 198 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 199 | togglers.click(); 200 | } 201 | }, 202 | 203 | /** 204 | * helper function to hide the search marks again 205 | */ 206 | hideSearchWords : function() { 207 | $('#searchbox .highlight-link').fadeOut(300); 208 | $('span.highlighted').removeClass('highlighted'); 209 | }, 210 | 211 | /** 212 | * make the url absolute 213 | */ 214 | makeURL : function(relativeURL) { 215 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 216 | }, 217 | 218 | /** 219 | * get the current relative url 220 | */ 221 | getCurrentURL : function() { 222 | var path = document.location.pathname; 223 | var parts = path.split(/\//); 224 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 225 | if (this == '..') 226 | parts.pop(); 227 | }); 228 | var url = parts.join('/'); 229 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 230 | } 231 | }; 232 | 233 | // quick alias for translations 234 | _ = Documentation.gettext; 235 | 236 | $(document).ready(function() { 237 | Documentation.init(); 238 | }); 239 | -------------------------------------------------------------------------------- /docs/build/html/testing.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Testing — Django Image Tools 0.7.b1 documentation 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 42 | 43 |
44 |
45 |
46 |
47 | 48 |
49 |

Testing

50 |

Often times you will find yourself having images required in your models, and testing these models can be a real pain in the 51 | donkey as you will have to create images just for that.

52 |

We want to make things simple for you, so you can import our method ‘create_dummy_image’ to easily create a dummy image for your tests!

53 |
create_dummy_image(filename=u'Test_image', title=u'Title', caption=u'Caption', alt_text=u'Alt Text',
 54 |                    credit=u'Credit'):
 55 | 
56 |
57 |

This will create a new dummy entry in the database, so all you have to do is to assign it to your model’s Foreign Key.

58 |

Remember to call

59 |
image.delete()
 60 | 
61 |
62 |

In your tearDown.

63 |

Also, django_image_tools will never delete your images, so you will have to delete them yourself. 64 | Just kidding, we made a script for that too.

65 |
delete_image(image)
 66 | 
67 |
68 |

So, here’s a complete script.

69 |
def setUp(self):
 70 |     partnerImage = create_dummy_image()
 71 |     model_with_image = Model(name=u'Coca cola', image=partnerImage)
 72 |     partner.save()
 73 | 
 74 | def testInsert(self):
 75 |     self.assertEqual(Model.objects.all()[0].name, 'Coca cola')
 76 | 
 77 | def tearDown(self):
 78 |     model_with_image = Model.objects.all()[0]
 79 |     delete_image(model_with_image.image)
 80 |     model_with_image.delete()
 81 | 
82 |
83 |
84 |

Support

85 |

Django Image Tools uses Travis CI to test the integration with several versions of Python and Django. 86 | You can see the list of currently supported combinations on our Travis CI page.

87 |
88 |
89 | 90 | 91 |
92 |
93 |
94 |
95 |
96 |

Table Of Contents

97 | 103 | 104 |

Previous topic

105 |

More features

107 |

This Page

108 | 112 | 124 | 125 |
126 |
127 |
128 |
129 | 141 | 145 | 146 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Django Image Tools documentation build configuration file, created by 4 | # sphinx-quickstart on Fri May 30 10:34:36 2014. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [] 32 | 33 | # Add any paths that contain templates here, relative to this directory. 34 | templates_path = ['_templates'] 35 | 36 | # The suffix of source filenames. 37 | source_suffix = '.rst' 38 | 39 | # The encoding of source files. 40 | #source_encoding = 'utf-8-sig' 41 | 42 | # The master toctree document. 43 | master_doc = 'index' 44 | 45 | # General information about the project. 46 | project = u'Django Image Tools' 47 | copyright = u'2014, Bonsai Studio' 48 | 49 | # The version info for the project you're documenting, acts as replacement for 50 | # |version| and |release|, also used in various other places throughout the 51 | # built documents. 52 | # 53 | # The short X.Y version. 54 | version = '0.7.b1' 55 | # The full version, including alpha/beta/rc tags. 56 | release = '0.7.b1' 57 | 58 | # The language for content autogenerated by Sphinx. Refer to documentation 59 | # for a list of supported languages. 60 | #language = None 61 | 62 | # There are two options for replacing |today|: either, you set today to some 63 | # non-false value, then it is used: 64 | #today = '' 65 | # Else, today_fmt is used as the format for a strftime call. 66 | #today_fmt = '%B %d, %Y' 67 | 68 | # List of patterns, relative to source directory, that match files and 69 | # directories to ignore when looking for source files. 70 | exclude_patterns = [] 71 | 72 | # The reST default role (used for this markup: `text`) to use for all 73 | # documents. 74 | #default_role = None 75 | 76 | # If true, '()' will be appended to :func: etc. cross-reference text. 77 | #add_function_parentheses = True 78 | 79 | # If true, the current module name will be prepended to all description 80 | # unit titles (such as .. function::). 81 | #add_module_names = True 82 | 83 | # If true, sectionauthor and moduleauthor directives will be shown in the 84 | # output. They are ignored by default. 85 | #show_authors = False 86 | 87 | # The name of the Pygments (syntax highlighting) style to use. 88 | pygments_style = 'sphinx' 89 | 90 | # A list of ignored prefixes for module index sorting. 91 | #modindex_common_prefix = [] 92 | 93 | # If true, keep warnings as "system message" paragraphs in the built documents. 94 | #keep_warnings = False 95 | 96 | 97 | # -- Options for HTML output ---------------------------------------------- 98 | 99 | # The theme to use for HTML and HTML Help pages. See the documentation for 100 | # a list of builtin themes. 101 | html_theme = 'default' 102 | 103 | # Theme options are theme-specific and customize the look and feel of a theme 104 | # further. For a list of options available for each theme, see the 105 | # documentation. 106 | #html_theme_options = {} 107 | 108 | # Add any paths that contain custom themes here, relative to this directory. 109 | #html_theme_path = [] 110 | 111 | # The name for this set of Sphinx documents. If None, it defaults to 112 | # " v documentation". 113 | #html_title = None 114 | 115 | # A shorter title for the navigation bar. Default is the same as html_title. 116 | #html_short_title = None 117 | 118 | # The name of an image file (relative to this directory) to place at the top 119 | # of the sidebar. 120 | #html_logo = None 121 | 122 | # The name of an image file (within the static path) to use as favicon of the 123 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 124 | # pixels large. 125 | #html_favicon = None 126 | 127 | # Add any paths that contain custom static files (such as style sheets) here, 128 | # relative to this directory. They are copied after the builtin static files, 129 | # so a file named "default.css" will overwrite the builtin "default.css". 130 | html_static_path = ['_static'] 131 | 132 | # Add any extra paths that contain custom files (such as robots.txt or 133 | # .htaccess) here, relative to this directory. These files are copied 134 | # directly to the root of the documentation. 135 | #html_extra_path = [] 136 | 137 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 138 | # using the given strftime format. 139 | #html_last_updated_fmt = '%b %d, %Y' 140 | 141 | # If true, SmartyPants will be used to convert quotes and dashes to 142 | # typographically correct entities. 143 | #html_use_smartypants = True 144 | 145 | # Custom sidebar templates, maps document names to template names. 146 | #html_sidebars = {} 147 | 148 | # Additional templates that should be rendered to pages, maps page names to 149 | # template names. 150 | #html_additional_pages = {} 151 | 152 | # If false, no module index is generated. 153 | #html_domain_indices = True 154 | 155 | # If false, no index is generated. 156 | #html_use_index = True 157 | 158 | # If true, the index is split into individual pages for each letter. 159 | #html_split_index = False 160 | 161 | # If true, links to the reST sources are added to the pages. 162 | #html_show_sourcelink = True 163 | 164 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 165 | #html_show_sphinx = True 166 | 167 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 168 | #html_show_copyright = True 169 | 170 | # If true, an OpenSearch description file will be output, and all pages will 171 | # contain a tag referring to it. The value of this option must be the 172 | # base URL from which the finished HTML is served. 173 | #html_use_opensearch = '' 174 | 175 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 176 | #html_file_suffix = None 177 | 178 | # Output file base name for HTML help builder. 179 | htmlhelp_basename = 'DjangoImageToolsdoc' 180 | 181 | 182 | # -- Options for LaTeX output --------------------------------------------- 183 | 184 | latex_elements = { 185 | # The paper size ('letterpaper' or 'a4paper'). 186 | #'papersize': 'letterpaper', 187 | 188 | # The font size ('10pt', '11pt' or '12pt'). 189 | #'pointsize': '10pt', 190 | 191 | # Additional stuff for the LaTeX preamble. 192 | #'preamble': '', 193 | } 194 | 195 | # Grouping the document tree into LaTeX files. List of tuples 196 | # (source start file, target name, title, 197 | # author, documentclass [howto, manual, or own class]). 198 | latex_documents = [ 199 | ('index', 'DjangoImageTools.tex', u'Django Image Tools Documentation', 200 | u'Bonsai Studio', 'manual'), 201 | ] 202 | 203 | # The name of an image file (relative to this directory) to place at the top of 204 | # the title page. 205 | #latex_logo = None 206 | 207 | # For "manual" documents, if this is true, then toplevel headings are parts, 208 | # not chapters. 209 | #latex_use_parts = False 210 | 211 | # If true, show page references after internal links. 212 | #latex_show_pagerefs = False 213 | 214 | # If true, show URL addresses after external links. 215 | #latex_show_urls = False 216 | 217 | # Documents to append as an appendix to all manuals. 218 | #latex_appendices = [] 219 | 220 | # If false, no module index is generated. 221 | #latex_domain_indices = True 222 | 223 | 224 | # -- Options for manual page output --------------------------------------- 225 | 226 | # One entry per manual page. List of tuples 227 | # (source start file, name, description, authors, manual section). 228 | man_pages = [ 229 | ('index', 'djangoimagetools', u'Django Image Tools Documentation', 230 | [u'Bonsai Studio'], 1) 231 | ] 232 | 233 | # If true, show URL addresses after external links. 234 | #man_show_urls = False 235 | 236 | 237 | # -- Options for Texinfo output ------------------------------------------- 238 | 239 | # Grouping the document tree into Texinfo files. List of tuples 240 | # (source start file, target name, title, author, 241 | # dir menu entry, description, category) 242 | texinfo_documents = [ 243 | ('index', 'DjangoImageTools', u'Django Image Tools Documentation', 244 | u'Bonsai Studio', 'DjangoImageTools', 'One line description of project.', 245 | 'Miscellaneous'), 246 | ] 247 | 248 | # Documents to append as an appendix to all manuals. 249 | #texinfo_appendices = [] 250 | 251 | # If false, no module index is generated. 252 | #texinfo_domain_indices = True 253 | 254 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 255 | #texinfo_show_urls = 'footnote' 256 | 257 | # If true, do not generate a @detailmenu in the "Top" node's menu. 258 | #texinfo_no_detailmenu = False 259 | -------------------------------------------------------------------------------- /docs/build/html/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | } 56 | 57 | div.sphinxsidebar ul { 58 | list-style: none; 59 | } 60 | 61 | div.sphinxsidebar ul ul, 62 | div.sphinxsidebar ul.want-points { 63 | margin-left: 20px; 64 | list-style: square; 65 | } 66 | 67 | div.sphinxsidebar ul ul { 68 | margin-top: 0; 69 | margin-bottom: 0; 70 | } 71 | 72 | div.sphinxsidebar form { 73 | margin-top: 10px; 74 | } 75 | 76 | div.sphinxsidebar input { 77 | border: 1px solid #98dbcc; 78 | font-family: sans-serif; 79 | font-size: 1em; 80 | } 81 | 82 | div.sphinxsidebar #searchbox input[type="text"] { 83 | width: 170px; 84 | } 85 | 86 | div.sphinxsidebar #searchbox input[type="submit"] { 87 | width: 30px; 88 | } 89 | 90 | img { 91 | border: 0; 92 | max-width: 100%; 93 | } 94 | 95 | /* -- search page ----------------------------------------------------------- */ 96 | 97 | ul.search { 98 | margin: 10px 0 0 20px; 99 | padding: 0; 100 | } 101 | 102 | ul.search li { 103 | padding: 5px 0 5px 20px; 104 | background-image: url(file.png); 105 | background-repeat: no-repeat; 106 | background-position: 0 7px; 107 | } 108 | 109 | ul.search li a { 110 | font-weight: bold; 111 | } 112 | 113 | ul.search li div.context { 114 | color: #888; 115 | margin: 2px 0 0 30px; 116 | text-align: left; 117 | } 118 | 119 | ul.keywordmatches li.goodmatch a { 120 | font-weight: bold; 121 | } 122 | 123 | /* -- index page ------------------------------------------------------------ */ 124 | 125 | table.contentstable { 126 | width: 90%; 127 | } 128 | 129 | table.contentstable p.biglink { 130 | line-height: 150%; 131 | } 132 | 133 | a.biglink { 134 | font-size: 1.3em; 135 | } 136 | 137 | span.linkdescr { 138 | font-style: italic; 139 | padding-top: 5px; 140 | font-size: 90%; 141 | } 142 | 143 | /* -- general index --------------------------------------------------------- */ 144 | 145 | table.indextable { 146 | width: 100%; 147 | } 148 | 149 | table.indextable td { 150 | text-align: left; 151 | vertical-align: top; 152 | } 153 | 154 | table.indextable dl, table.indextable dd { 155 | margin-top: 0; 156 | margin-bottom: 0; 157 | } 158 | 159 | table.indextable tr.pcap { 160 | height: 10px; 161 | } 162 | 163 | table.indextable tr.cap { 164 | margin-top: 10px; 165 | background-color: #f2f2f2; 166 | } 167 | 168 | img.toggler { 169 | margin-right: 3px; 170 | margin-top: 3px; 171 | cursor: pointer; 172 | } 173 | 174 | div.modindex-jumpbox { 175 | border-top: 1px solid #ddd; 176 | border-bottom: 1px solid #ddd; 177 | margin: 1em 0 1em 0; 178 | padding: 0.4em; 179 | } 180 | 181 | div.genindex-jumpbox { 182 | border-top: 1px solid #ddd; 183 | border-bottom: 1px solid #ddd; 184 | margin: 1em 0 1em 0; 185 | padding: 0.4em; 186 | } 187 | 188 | /* -- general body styles --------------------------------------------------- */ 189 | 190 | a.headerlink { 191 | visibility: hidden; 192 | } 193 | 194 | h1:hover > a.headerlink, 195 | h2:hover > a.headerlink, 196 | h3:hover > a.headerlink, 197 | h4:hover > a.headerlink, 198 | h5:hover > a.headerlink, 199 | h6:hover > a.headerlink, 200 | dt:hover > a.headerlink { 201 | visibility: visible; 202 | } 203 | 204 | div.body p.caption { 205 | text-align: inherit; 206 | } 207 | 208 | div.body td { 209 | text-align: left; 210 | } 211 | 212 | .field-list ul { 213 | padding-left: 1em; 214 | } 215 | 216 | .first { 217 | margin-top: 0 !important; 218 | } 219 | 220 | p.rubric { 221 | margin-top: 30px; 222 | font-weight: bold; 223 | } 224 | 225 | img.align-left, .figure.align-left, object.align-left { 226 | clear: left; 227 | float: left; 228 | margin-right: 1em; 229 | } 230 | 231 | img.align-right, .figure.align-right, object.align-right { 232 | clear: right; 233 | float: right; 234 | margin-left: 1em; 235 | } 236 | 237 | img.align-center, .figure.align-center, object.align-center { 238 | display: block; 239 | margin-left: auto; 240 | margin-right: auto; 241 | } 242 | 243 | .align-left { 244 | text-align: left; 245 | } 246 | 247 | .align-center { 248 | text-align: center; 249 | } 250 | 251 | .align-right { 252 | text-align: right; 253 | } 254 | 255 | /* -- sidebars -------------------------------------------------------------- */ 256 | 257 | div.sidebar { 258 | margin: 0 0 0.5em 1em; 259 | border: 1px solid #ddb; 260 | padding: 7px 7px 0 7px; 261 | background-color: #ffe; 262 | width: 40%; 263 | float: right; 264 | } 265 | 266 | p.sidebar-title { 267 | font-weight: bold; 268 | } 269 | 270 | /* -- topics ---------------------------------------------------------------- */ 271 | 272 | div.topic { 273 | border: 1px solid #ccc; 274 | padding: 7px 7px 0 7px; 275 | margin: 10px 0 10px 0; 276 | } 277 | 278 | p.topic-title { 279 | font-size: 1.1em; 280 | font-weight: bold; 281 | margin-top: 10px; 282 | } 283 | 284 | /* -- admonitions ----------------------------------------------------------- */ 285 | 286 | div.admonition { 287 | margin-top: 10px; 288 | margin-bottom: 10px; 289 | padding: 7px; 290 | } 291 | 292 | div.admonition dt { 293 | font-weight: bold; 294 | } 295 | 296 | div.admonition dl { 297 | margin-bottom: 0; 298 | } 299 | 300 | p.admonition-title { 301 | margin: 0px 10px 5px 0px; 302 | font-weight: bold; 303 | } 304 | 305 | div.body p.centered { 306 | text-align: center; 307 | margin-top: 25px; 308 | } 309 | 310 | /* -- tables ---------------------------------------------------------------- */ 311 | 312 | table.docutils { 313 | border: 0; 314 | border-collapse: collapse; 315 | } 316 | 317 | table.docutils td, table.docutils th { 318 | padding: 1px 8px 1px 5px; 319 | border-top: 0; 320 | border-left: 0; 321 | border-right: 0; 322 | border-bottom: 1px solid #aaa; 323 | } 324 | 325 | table.field-list td, table.field-list th { 326 | border: 0 !important; 327 | } 328 | 329 | table.footnote td, table.footnote th { 330 | border: 0 !important; 331 | } 332 | 333 | th { 334 | text-align: left; 335 | padding-right: 5px; 336 | } 337 | 338 | table.citation { 339 | border-left: solid 1px gray; 340 | margin-left: 1px; 341 | } 342 | 343 | table.citation td { 344 | border-bottom: none; 345 | } 346 | 347 | /* -- other body styles ----------------------------------------------------- */ 348 | 349 | ol.arabic { 350 | list-style: decimal; 351 | } 352 | 353 | ol.loweralpha { 354 | list-style: lower-alpha; 355 | } 356 | 357 | ol.upperalpha { 358 | list-style: upper-alpha; 359 | } 360 | 361 | ol.lowerroman { 362 | list-style: lower-roman; 363 | } 364 | 365 | ol.upperroman { 366 | list-style: upper-roman; 367 | } 368 | 369 | dl { 370 | margin-bottom: 15px; 371 | } 372 | 373 | dd p { 374 | margin-top: 0px; 375 | } 376 | 377 | dd ul, dd table { 378 | margin-bottom: 10px; 379 | } 380 | 381 | dd { 382 | margin-top: 3px; 383 | margin-bottom: 10px; 384 | margin-left: 30px; 385 | } 386 | 387 | dt:target, .highlighted { 388 | background-color: #fbe54e; 389 | } 390 | 391 | dl.glossary dt { 392 | font-weight: bold; 393 | font-size: 1.1em; 394 | } 395 | 396 | .field-list ul { 397 | margin: 0; 398 | padding-left: 1em; 399 | } 400 | 401 | .field-list p { 402 | margin: 0; 403 | } 404 | 405 | .optional { 406 | font-size: 1.3em; 407 | } 408 | 409 | .versionmodified { 410 | font-style: italic; 411 | } 412 | 413 | .system-message { 414 | background-color: #fda; 415 | padding: 5px; 416 | border: 3px solid red; 417 | } 418 | 419 | .footnote:target { 420 | background-color: #ffa; 421 | } 422 | 423 | .line-block { 424 | display: block; 425 | margin-top: 1em; 426 | margin-bottom: 1em; 427 | } 428 | 429 | .line-block .line-block { 430 | margin-top: 0; 431 | margin-bottom: 0; 432 | margin-left: 1.5em; 433 | } 434 | 435 | .guilabel, .menuselection { 436 | font-family: sans-serif; 437 | } 438 | 439 | .accelerator { 440 | text-decoration: underline; 441 | } 442 | 443 | .classifier { 444 | font-style: oblique; 445 | } 446 | 447 | abbr, acronym { 448 | border-bottom: dotted 1px; 449 | cursor: help; 450 | } 451 | 452 | /* -- code displays --------------------------------------------------------- */ 453 | 454 | pre { 455 | overflow: auto; 456 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 457 | } 458 | 459 | td.linenos pre { 460 | padding: 5px 0px; 461 | border: 0; 462 | background-color: transparent; 463 | color: #aaa; 464 | } 465 | 466 | table.highlighttable { 467 | margin-left: 0.5em; 468 | } 469 | 470 | table.highlighttable td { 471 | padding: 0 0.5em 0 0.5em; 472 | } 473 | 474 | tt.descname { 475 | background-color: transparent; 476 | font-weight: bold; 477 | font-size: 1.2em; 478 | } 479 | 480 | tt.descclassname { 481 | background-color: transparent; 482 | } 483 | 484 | tt.xref, a tt { 485 | background-color: transparent; 486 | font-weight: bold; 487 | } 488 | 489 | h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { 490 | background-color: transparent; 491 | } 492 | 493 | .viewcode-link { 494 | float: right; 495 | } 496 | 497 | .viewcode-back { 498 | float: right; 499 | font-family: sans-serif; 500 | } 501 | 502 | div.viewcode-block:target { 503 | margin: -1px -10px; 504 | padding: 0 10px; 505 | } 506 | 507 | /* -- math display ---------------------------------------------------------- */ 508 | 509 | img.math { 510 | vertical-align: middle; 511 | } 512 | 513 | div.body div.math p { 514 | text-align: center; 515 | } 516 | 517 | span.eqno { 518 | float: right; 519 | } 520 | 521 | /* -- printout stylesheet --------------------------------------------------- */ 522 | 523 | @media print { 524 | div.document, 525 | div.documentwrapper, 526 | div.bodywrapper { 527 | margin: 0 !important; 528 | width: 100%; 529 | } 530 | 531 | div.sphinxsidebar, 532 | div.related, 533 | div.footer, 534 | #top-link { 535 | display: none; 536 | } 537 | } -------------------------------------------------------------------------------- /docs/build/html/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /htmlcov/jquery.tablesorter.min.js: -------------------------------------------------------------------------------- 1 | 2 | (function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;ib)?1:0));};function sortTextDesc(a,b){return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i -1) { 47 | var cookies = document.cookie.split(";"); 48 | for (i = 0; i < cookies.length; i++) { 49 | var parts = cookies[i].split("="); 50 | 51 | if ($.trim(parts[0]) === cookie_name && parts[1]) { 52 | sort_list = eval("[[" + parts[1] + "]]"); 53 | break; 54 | } 55 | } 56 | } 57 | 58 | // Create a new widget which exists only to save and restore 59 | // the sort order: 60 | $.tablesorter.addWidget({ 61 | id: "persistentSort", 62 | 63 | // Format is called by the widget before displaying: 64 | format: function (table) { 65 | if (table.config.sortList.length === 0 && sort_list.length > 0) { 66 | // This table hasn't been sorted before - we'll use 67 | // our stored settings: 68 | $(table).trigger('sorton', [sort_list]); 69 | } 70 | else { 71 | // This is not the first load - something has 72 | // already defined sorting so we'll just update 73 | // our stored value to match: 74 | sort_list = table.config.sortList; 75 | } 76 | } 77 | }); 78 | 79 | // Configure our tablesorter to handle the variable number of 80 | // columns produced depending on report options: 81 | var headers = []; 82 | var col_count = $("table.index > thead > tr > th").length; 83 | 84 | headers[0] = { sorter: 'text' }; 85 | for (i = 1; i < col_count-1; i++) { 86 | headers[i] = { sorter: 'digit' }; 87 | } 88 | headers[col_count-1] = { sorter: 'percent' }; 89 | 90 | // Enable the table sorter: 91 | $("table.index").tablesorter({ 92 | widgets: ['persistentSort'], 93 | headers: headers 94 | }); 95 | 96 | coverage.assign_shortkeys(); 97 | coverage.wire_up_help_panel(); 98 | 99 | // Watch for page unload events so we can save the final sort settings: 100 | $(window).unload(function () { 101 | document.cookie = cookie_name + "=" + sort_list.toString() + "; path=/"; 102 | }); 103 | }; 104 | 105 | // -- pyfile stuff -- 106 | 107 | coverage.pyfile_ready = function ($) { 108 | // If we're directed to a particular line number, highlight the line. 109 | var frag = location.hash; 110 | if (frag.length > 2 && frag[1] === 'n') { 111 | $(frag).addClass('highlight'); 112 | coverage.set_sel(parseInt(frag.substr(2), 10)); 113 | } 114 | else { 115 | coverage.set_sel(0); 116 | } 117 | 118 | $(document) 119 | .bind('keydown', 'j', coverage.to_next_chunk_nicely) 120 | .bind('keydown', 'k', coverage.to_prev_chunk_nicely) 121 | .bind('keydown', '0', coverage.to_top) 122 | .bind('keydown', '1', coverage.to_first_chunk) 123 | ; 124 | 125 | $(".button_toggle_run").click(function (evt) {coverage.toggle_lines(evt.target, "run");}); 126 | $(".button_toggle_exc").click(function (evt) {coverage.toggle_lines(evt.target, "exc");}); 127 | $(".button_toggle_mis").click(function (evt) {coverage.toggle_lines(evt.target, "mis");}); 128 | $(".button_toggle_par").click(function (evt) {coverage.toggle_lines(evt.target, "par");}); 129 | 130 | coverage.assign_shortkeys(); 131 | coverage.wire_up_help_panel(); 132 | }; 133 | 134 | coverage.toggle_lines = function (btn, cls) { 135 | btn = $(btn); 136 | var hide = "hide_"+cls; 137 | if (btn.hasClass(hide)) { 138 | $("#source ."+cls).removeClass(hide); 139 | btn.removeClass(hide); 140 | } 141 | else { 142 | $("#source ."+cls).addClass(hide); 143 | btn.addClass(hide); 144 | } 145 | }; 146 | 147 | // Return the nth line div. 148 | coverage.line_elt = function (n) { 149 | return $("#t" + n); 150 | }; 151 | 152 | // Return the nth line number div. 153 | coverage.num_elt = function (n) { 154 | return $("#n" + n); 155 | }; 156 | 157 | // Return the container of all the code. 158 | coverage.code_container = function () { 159 | return $(".linenos"); 160 | }; 161 | 162 | // Set the selection. b and e are line numbers. 163 | coverage.set_sel = function (b, e) { 164 | // The first line selected. 165 | coverage.sel_begin = b; 166 | // The next line not selected. 167 | coverage.sel_end = (e === undefined) ? b+1 : e; 168 | }; 169 | 170 | coverage.to_top = function () { 171 | coverage.set_sel(0, 1); 172 | coverage.scroll_window(0); 173 | }; 174 | 175 | coverage.to_first_chunk = function () { 176 | coverage.set_sel(0, 1); 177 | coverage.to_next_chunk(); 178 | }; 179 | 180 | coverage.is_transparent = function (color) { 181 | // Different browsers return different colors for "none". 182 | return color === "transparent" || color === "rgba(0, 0, 0, 0)"; 183 | }; 184 | 185 | coverage.to_next_chunk = function () { 186 | var c = coverage; 187 | 188 | // Find the start of the next colored chunk. 189 | var probe = c.sel_end; 190 | while (true) { 191 | var probe_line = c.line_elt(probe); 192 | if (probe_line.length === 0) { 193 | return; 194 | } 195 | var color = probe_line.css("background-color"); 196 | if (!c.is_transparent(color)) { 197 | break; 198 | } 199 | probe++; 200 | } 201 | 202 | // There's a next chunk, `probe` points to it. 203 | var begin = probe; 204 | 205 | // Find the end of this chunk. 206 | var next_color = color; 207 | while (next_color === color) { 208 | probe++; 209 | probe_line = c.line_elt(probe); 210 | next_color = probe_line.css("background-color"); 211 | } 212 | c.set_sel(begin, probe); 213 | c.show_selection(); 214 | }; 215 | 216 | coverage.to_prev_chunk = function () { 217 | var c = coverage; 218 | 219 | // Find the end of the prev colored chunk. 220 | var probe = c.sel_begin-1; 221 | var probe_line = c.line_elt(probe); 222 | if (probe_line.length === 0) { 223 | return; 224 | } 225 | var color = probe_line.css("background-color"); 226 | while (probe > 0 && c.is_transparent(color)) { 227 | probe--; 228 | probe_line = c.line_elt(probe); 229 | if (probe_line.length === 0) { 230 | return; 231 | } 232 | color = probe_line.css("background-color"); 233 | } 234 | 235 | // There's a prev chunk, `probe` points to its last line. 236 | var end = probe+1; 237 | 238 | // Find the beginning of this chunk. 239 | var prev_color = color; 240 | while (prev_color === color) { 241 | probe--; 242 | probe_line = c.line_elt(probe); 243 | prev_color = probe_line.css("background-color"); 244 | } 245 | c.set_sel(probe+1, end); 246 | c.show_selection(); 247 | }; 248 | 249 | // Return the line number of the line nearest pixel position pos 250 | coverage.line_at_pos = function (pos) { 251 | var l1 = coverage.line_elt(1), 252 | l2 = coverage.line_elt(2), 253 | result; 254 | if (l1.length && l2.length) { 255 | var l1_top = l1.offset().top, 256 | line_height = l2.offset().top - l1_top, 257 | nlines = (pos - l1_top) / line_height; 258 | if (nlines < 1) { 259 | result = 1; 260 | } 261 | else { 262 | result = Math.ceil(nlines); 263 | } 264 | } 265 | else { 266 | result = 1; 267 | } 268 | return result; 269 | }; 270 | 271 | // Returns 0, 1, or 2: how many of the two ends of the selection are on 272 | // the screen right now? 273 | coverage.selection_ends_on_screen = function () { 274 | if (coverage.sel_begin === 0) { 275 | return 0; 276 | } 277 | 278 | var top = coverage.line_elt(coverage.sel_begin); 279 | var next = coverage.line_elt(coverage.sel_end-1); 280 | 281 | return ( 282 | (top.isOnScreen() ? 1 : 0) + 283 | (next.isOnScreen() ? 1 : 0) 284 | ); 285 | }; 286 | 287 | coverage.to_next_chunk_nicely = function () { 288 | coverage.finish_scrolling(); 289 | if (coverage.selection_ends_on_screen() === 0) { 290 | // The selection is entirely off the screen: select the top line on 291 | // the screen. 292 | var win = $(window); 293 | coverage.select_line_or_chunk(coverage.line_at_pos(win.scrollTop())); 294 | } 295 | coverage.to_next_chunk(); 296 | }; 297 | 298 | coverage.to_prev_chunk_nicely = function () { 299 | coverage.finish_scrolling(); 300 | if (coverage.selection_ends_on_screen() === 0) { 301 | var win = $(window); 302 | coverage.select_line_or_chunk(coverage.line_at_pos(win.scrollTop() + win.height())); 303 | } 304 | coverage.to_prev_chunk(); 305 | }; 306 | 307 | // Select line number lineno, or if it is in a colored chunk, select the 308 | // entire chunk 309 | coverage.select_line_or_chunk = function (lineno) { 310 | var c = coverage; 311 | var probe_line = c.line_elt(lineno); 312 | if (probe_line.length === 0) { 313 | return; 314 | } 315 | var the_color = probe_line.css("background-color"); 316 | if (!c.is_transparent(the_color)) { 317 | // The line is in a highlighted chunk. 318 | // Search backward for the first line. 319 | var probe = lineno; 320 | var color = the_color; 321 | while (probe > 0 && color === the_color) { 322 | probe--; 323 | probe_line = c.line_elt(probe); 324 | if (probe_line.length === 0) { 325 | break; 326 | } 327 | color = probe_line.css("background-color"); 328 | } 329 | var begin = probe + 1; 330 | 331 | // Search forward for the last line. 332 | probe = lineno; 333 | color = the_color; 334 | while (color === the_color) { 335 | probe++; 336 | probe_line = c.line_elt(probe); 337 | color = probe_line.css("background-color"); 338 | } 339 | 340 | coverage.set_sel(begin, probe); 341 | } 342 | else { 343 | coverage.set_sel(lineno); 344 | } 345 | }; 346 | 347 | coverage.show_selection = function () { 348 | var c = coverage; 349 | 350 | // Highlight the lines in the chunk 351 | c.code_container().find(".highlight").removeClass("highlight"); 352 | for (var probe = c.sel_begin; probe > 0 && probe < c.sel_end; probe++) { 353 | c.num_elt(probe).addClass("highlight"); 354 | } 355 | 356 | c.scroll_to_selection(); 357 | }; 358 | 359 | coverage.scroll_to_selection = function () { 360 | // Scroll the page if the chunk isn't fully visible. 361 | if (coverage.selection_ends_on_screen() < 2) { 362 | // Need to move the page. The html,body trick makes it scroll in all 363 | // browsers, got it from http://stackoverflow.com/questions/3042651 364 | var top = coverage.line_elt(coverage.sel_begin); 365 | var top_pos = parseInt(top.offset().top, 10); 366 | coverage.scroll_window(top_pos - 30); 367 | } 368 | }; 369 | 370 | coverage.scroll_window = function (to_pos) { 371 | $("html,body").animate({scrollTop: to_pos}, 200); 372 | }; 373 | 374 | coverage.finish_scrolling = function () { 375 | $("html,body").stop(true, true); 376 | }; 377 | --------------------------------------------------------------------------------