{ "info": { "author": "Thomas Weholt", "author_email": "thomas@weholt.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database" ], "description": "=========\nPhotofile\n=========\n\nVersion : 0.5.0\nAuthor : Thomas Weholt \nLicense : Modified BSD\nWWW : https://bitbucket.org/weholt/django-photofile\nStatus : Beta\n\n\nAbout\n-----\n* Templatetags for thumbnail generation, supports automatic rotation based on EXIF.Orientation.\n* An abstract model for photos, handling extraction of EXIF-metadata.\n* Next planned feature: tagging - reading and writing tags to and from photo metadata (IPTC/XMP).\n\nChangelog\n---------\n0.5.0 - Some refactoring for an upcoming project.\n0.4.0 - Added decorator for finding screen resolution. See How-section for example.\n\n\nHow\n---\n \n\nProvides a templatetag called generate_thumbnail which takes two or three parameters:\n\nParam #1 : an object (imagefile), like a model instance, with a property/field called unique_filename, complete_filename or filename.\nPhotofile will check in that order.\n\nParam #2: resolution, specified as x, like 320x280.\n\nParam #3: optional \"crop\" - which will enforce cropping of the photo.\n\nThe thumbnail will be written in a dir called \"thumbs\" in your STATICFILES_DIRS or STATIC_ROOT. If no dir exists\ncalled thumbs, it will be created.\n\nThe generated thumbnail will be named _x.. When cropping is used it will be named\n_x_crop.. For instance, thumbnail for test.jpg in resolution 200x300 will be named\ntest_200x300.jpg.\n\nPhotofile will try to use caching if enabled, but it caches the url to the thumbnail, not the image itself so it's not\nvery efficient yet.\n\nNB! It's highly recommended to have some way of ensuring that the filename given to photofile is unique. That's why it will\nlook for a property called unique_filename first.\n\nTo use the abstract model, do something like this::\n\n from django.db import models\n from photofile.models import PhotoMetadata\n\n class Photo(PhotoMetadata):\n image = models.ImageField(upload_to=settings.STATIC_DATA)\n title = models.CharField(max_length=100)\n\n def __unicode__(self):\n if self.width and self.height:\n return \"%s (%sx%s)\" % (self.title, self.width, self.height)\n else:\n return self.title\n\nSTATIC_DATA mentioned above is for testing only and can be defined in settings.py like so::\n\n import tempfile\n import os\n STATIC_DATA = os.path.join(tempfile.gettempdir(), 'staticdata')\n if not os.path.exists(STATIC_DATA):\n os.makedirs(STATIC_DATA)\n\n MEDIA_ROOT = STATIC_DATA\n\n\n STATICFILES_DIRS = (\n STATIC_DATA,\n )\n\nWhen uploading a photo and saving it for the first time EXIF-metadata will be extracted and stored in the db. These EXIF-properties\nare currently available, but longitude, latitude and altitude is not implemented yet:\n\n* width\n* height\n* longitude\n* latitude\n* altitude\n* exif_date\n* camera_model\n* orientation\n* exposure_time\n* fnumber\n* exposure_program\n* iso_speed\n* metering_mode\n* light_source\n* flash_used\n* focal_length\n* exposure_mode\n* whitebalance\n* focal_length_in_35mm\n\nThe source contains an example project with more details on how to implement a suitable admin.py, some templates etc.\n\nNew in 0.4.0:\n\nPhotofile can detect screen resolution using a decorator, like so:\n\n from django.http import HttpResponseRedirect, HttpResponse\n from photofile.decorators import provide_screen_info\n\n @provide_screen_info\n def index(request):\n return HttpResponse(\"%sx%s\" % (request.session.get('screen_width'), request.session.get('screen_height')))\n\nYou also need to add the photofile.urls:\n\n from django.conf.urls.defaults import patterns, include, url\n import photofile\n\n urlpatterns = patterns('',\n url(r'^default.html$', 'testme.views.index'),\n )\n urlpatterns += photofile.urls.urlpatterns;\n\n\nThis also makes it possible for photofile to automatically generate maximized thumbnails depending on the screen resolution:\n\n \n\nusing the max option for resolution.\n\n\nWhy another thumbnail app for django?\n-------------------------------------\nI've looked at sorl-thumbnail and others, and initially I wanted to use an existing project, but none of them supported\nautomatic rotation based on EXIF.Orientation.\n\nInstallation\n------------\n* Alternative a) pip install django-photofile.\n* Alternative b) download source, unpack and do python setup.py install.\n* Alternative c) hg clone https://bitbucket.org/weholt/django-photofile and do python setup.py install.\n\nUsage\n-----\nIn settings.py:\n* Add 'photofile' to your INSTALLED_APPS.\n* Set up caching if you want.\n* Add a dir to your STATICFILES_DIRS or set STATIC_ROOT.\n\nIn your template:\n {% load photofile_tags %}\n\n \nor\n \n\nWhere imagefile is an object with at a property/field called:\n* unique_filename or\n* complete_filename or\n* filename\n\nResolution is specified as x, for instance 640x480 and if you want to crop the photo add crop as shown in\nthe example over.\n\nRequirements\n------------\n* django\n* PIL\n* pyexiv2\n* django-taggit", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/weholt/django-photofile", "keywords": "photo thumbnail generation django metadata", "license": "Modified BSD", "maintainer": null, "maintainer_email": null, "name": "Django-Photofile", "package_url": "https://pypi.org/project/Django-Photofile/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Django-Photofile/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/weholt/django-photofile" }, "release_url": "https://pypi.org/project/Django-Photofile/0.5.0/", "requires_dist": null, "requires_python": null, "summary": "Templatetags for thumbnail generation, with automatic rotation based on EXIF.Orientation. Among other things.", "version": "0.5.0" }, "last_serial": 784137, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2645687abb04917d2c0f0de5a5441a55", "sha256": "4e1ada964ccaa8d39dd7fceb24ff91e36307912c81749616a9843c53ee5a3b12" }, "downloads": -1, "filename": "Django-Photofile-0.1.0.zip", "has_sig": false, "md5_digest": "2645687abb04917d2c0f0de5a5441a55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21716, "upload_time": "2011-05-09T15:59:26", "url": "https://files.pythonhosted.org/packages/be/88/9fd3bf9f05a125a5c96c14d470366df8f5137cab2c351a0ce3ec20e4c81d/Django-Photofile-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d5b44a7283bdf3882ab64fb81c5b03de", "sha256": "7a6d19c0216606069888c05a8845ce24d408273a7a56965febc4be57ee429130" }, "downloads": -1, "filename": "Django-Photofile-0.1.1.zip", "has_sig": false, "md5_digest": "d5b44a7283bdf3882ab64fb81c5b03de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21739, "upload_time": "2011-05-09T16:00:42", "url": "https://files.pythonhosted.org/packages/82/44/090341e136748f6032cc2b922e4ed595e0a4b75f86b0f45a1c59e0dfbae5/Django-Photofile-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "60d753623378e200192c6f763694793b", "sha256": "b5c33431b1c2fe9f64efab63ecbaf0d988ec0b6705716bd5f9fdfe3c037bccc5" }, "downloads": -1, "filename": "Django-Photofile-0.1.2.zip", "has_sig": false, "md5_digest": "60d753623378e200192c6f763694793b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21710, "upload_time": "2011-05-09T16:02:38", "url": "https://files.pythonhosted.org/packages/fe/46/675ef8e93b0ff364b30e770c2a1a1415b5acc1cc502197aa9d5c720545dd/Django-Photofile-0.1.2.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f1d6054f136a3e6863545b31c437289f", "sha256": "9ebdf62e73c853e651005d8abb107ded9a88ee248926713138f954cd53863ae9" }, "downloads": -1, "filename": "Django-Photofile-0.2.0.zip", "has_sig": false, "md5_digest": "f1d6054f136a3e6863545b31c437289f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32044, "upload_time": "2011-05-10T21:48:29", "url": "https://files.pythonhosted.org/packages/94/a1/35a9ef145c6df041ffb49f2118fd446f4fd539feff20bb7230b7e151c948/Django-Photofile-0.2.0.zip" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "ed1c7e4133700a513a3f9882ea809351", "sha256": "e87c37a193dc46c7f3c949203452b86d52b42eaa39085e42e814ee8bd9176a51" }, "downloads": -1, "filename": "Django-Photofile-0.4.0.zip", "has_sig": false, "md5_digest": "ed1c7e4133700a513a3f9882ea809351", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25444, "upload_time": "2012-01-09T23:42:04", "url": "https://files.pythonhosted.org/packages/b3/d0/274f647a55c484d71083874ef365d9460b526a8f0e0c43bee466827aa37d/Django-Photofile-0.4.0.zip" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "7cf1c5bb343b15ee719952d3371a4d01", "sha256": "127dc7c555bf94bcdf3dbb97a432b88ad68b8f13d08ade41ecc4c23f1fc148ea" }, "downloads": -1, "filename": "Django-Photofile-0.5.0.zip", "has_sig": false, "md5_digest": "7cf1c5bb343b15ee719952d3371a4d01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54792, "upload_time": "2012-08-21T14:53:19", "url": "https://files.pythonhosted.org/packages/0b/c5/1bf337caa66a6784f15c782afc1f9e7168cf85c1c4c50b9083ae45876e4e/Django-Photofile-0.5.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7cf1c5bb343b15ee719952d3371a4d01", "sha256": "127dc7c555bf94bcdf3dbb97a432b88ad68b8f13d08ade41ecc4c23f1fc148ea" }, "downloads": -1, "filename": "Django-Photofile-0.5.0.zip", "has_sig": false, "md5_digest": "7cf1c5bb343b15ee719952d3371a4d01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54792, "upload_time": "2012-08-21T14:53:19", "url": "https://files.pythonhosted.org/packages/0b/c5/1bf337caa66a6784f15c782afc1f9e7168cf85c1c4c50b9083ae45876e4e/Django-Photofile-0.5.0.zip" } ] }