Commit graph

69 commits

Author SHA1 Message Date
Tomas Babej
2286fa62a8 Merge pull request #14 from holzenburg/master
Rotate according to EXIF data + random IDs
2014-07-19 17:55:09 +02:00
Tomas Babej
25c77738c3 Merge remote-tracking branch 'eureka/eureka'
Conflicts:
	avatar/forms.py
	avatar/models.py
	avatar/urls.py
2014-07-19 17:10:04 +02:00
Arne Holzenburg
f35a4b8267 Transpose based on EXIF orientation (Fix)
Transpose the original image before resizing based on EXIF orientation
information to display image in the correct orientation. If someone
uploads an image from an iPhone (for example) the image is currently
often rendered in the wrong orientation.
2014-03-22 13:40:56 +01:00
Arne Holzenburg
a0de7f59f4 Transpose based on EXIF orientation
Transpose the original image before resizing based on EXIF orientation
information to display image in the correct orientation. If someone
uploads an image from an iPhone (for example) the image is currently
often rendered in the wrong orientation.
2014-03-22 13:35:13 +01:00
Andrea de Marco
c1f278bb84 Preserve RGBA image.mode 2014-01-10 10:35:07 +01:00
Jannis Leidel
65d5f66b9b Use django-appconf for nicer settings handling. 2013-09-13 17:59:52 +02:00
Jannis Leidel
49148f1d70 Reduce repetition. 2013-09-13 17:24:02 +02:00
Enric Caumons
5ad41df92c prevents crash when deleting user with attached avatars (fixes #52) 2013-09-10 01:19:29 +02:00
andrean
6c9b44e2e7 fix create_thumbnail saving for images not requiring resize 2013-08-14 16:18:52 +02:00
Jannis Leidel
2131c79441 Use PIL.Image. 2013-08-01 14:48:43 +02:00
Jannis Leidel
b12bb9f193 Use str just in case. 2013-08-01 14:35:59 +02:00
Jannis Leidel
7a32e3bd47 More Python 3 fixes. 2013-08-01 14:32:03 +02:00
Jannis Leidel
05ef51078f Use integer sizes. 2013-08-01 14:11:59 +02:00
Jannis Leidel
29570b1a1b Use storage file directly. 2013-08-01 14:09:04 +02:00
Jannis Leidel
fc98737ce3 Use six.StringIO. 2013-08-01 13:29:19 +02:00
Jannis Leidel
a47e2e2811 Fixed some Python 3 bug. 2013-08-01 13:19:56 +02:00
Jannis Leidel
57d77caeb0 Revamped tests and added Travis config. 2013-08-01 13:12:49 +02:00
Jannis Leidel
b8844d8cd9 Merge branch 'master' of git://github.com/DrMeers/django-avatar into DrMeers-master
Conflicts:
	avatar/models.py
2013-05-27 10:13:16 +02:00
Brendon Crawford
8627f67046 Replace Django Hashcompat with Hashlib 2013-03-22 13:55:28 -07:00
Simon Meers
7ee83431b3 More quickly scrawled / untested custom user model support changes 2013-03-15 21:45:24 +11:00
Simon Meers
93fb42fd83 Commence experimental support for custom User models. 2013-03-15 21:29:07 +11:00
Mathieu Pillard
aac26b8c70 Add a get_absolute_url() method to help implementors (it needs to exists for projects to overwrite it)
Conflicts:
	avatar/models.py
2013-03-04 12:32:48 +01:00
Jannis Leidel
68731b6bc6 Merge remote-tracking branch 'chadpaulson/master'
Conflicts:
	MANIFEST.in
	avatar/models.py
	avatar/settings.py
	avatar/templatetags/avatar_tags.py
	avatar/views.py
	setup.py
2013-03-04 11:43:23 +01:00
Chad Paulson
b5937382ab Added post_delete signal to Avatar model in order to clean up the file system when AVATAR_MAX_AVATARS_PER_USER is equal to 1 or when Avatar instances are removed. This functionality is controlled by the new AVATAR_CLEAN_REMOVED setting which is False by default. 2013-01-18 19:39:31 -06:00
Jannis Leidel
264c83671a Fixed invalidating the avatar cache by making it happen post_save and post_delete. 2012-10-05 15:52:02 +02:00
Jannis Leidel
2650cf0282 Minor syntax cleanup. 2012-10-05 12:07:47 +02:00
Jannis Leidel
c8bf40ebe3 Catch IOError in the rest of the create_thumbnail method, too, to work around an issue with Django>1.4.1 which verifies the images being saved. 2012-10-05 12:07:13 +02:00
Jannis Leidel
7b0d9b4a9a Added ability to specify a custom storage backend. 2012-04-20 17:45:56 +02:00
Jannis Leidel
7913cb7a5c Use django.utils.timezone.now if needed. 2012-01-24 16:44:25 +01:00
Jannis Leidel
7f38a3acf5 Added new AVATAR_DEFAULT_SIZE setting with a default of 80. 2010-06-26 19:01:22 +02:00
Jannis Leidel
22b85c5028 Moved settings from avatar main module to own settings module and signal callback to models module to be able to prevent import errors in non-Django Python environments. 2010-06-26 19:00:31 +02:00
Jannis Leidel
17b183d315 Also invalidate the cache when deleting an avatar. 2010-06-26 17:20:29 +02:00
Jannis Leidel
1413c4000d Added template tag caching (default timeout: 60 minutes) to template tags, includes invalidation. 2010-06-26 16:49:35 +02:00
Jannis Leidel
92f9794701 Merge branch 'master' of git://github.com/alex/django-avatar 2010-06-24 18:02:32 +02:00
Alex Gaynor
4180a7a101 Fixes for Django 1.2 2010-06-24 10:56:04 -05:00
Mathieu Pillard
32b61553d2 Fix for issue #12 on ericflo/django-avatar, proposed by fakeempire
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2010-05-06 00:44:45 +02:00
Jannis Leidel
c240f23b86 Handle non-ASCII filenames correctly when hashing the filename. 2010-03-16 15:34:40 +01:00
Jannis Leidel
929c8a0e4f Added thumb quality setting which is used in the create_thumbnail() method. 2010-03-16 14:56:15 +01:00
PLHW
233422eefd adding default quality param to create_thumbnail
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2010-03-16 14:31:25 +01:00
Eric Florenzano
111ecd8543 Obsessive compulsive import cleanup 2010-02-22 18:52:37 -05:00
Eric Florenzano
5648cb9f11 Cleanup, reorganization, moved the default avatar url to conform to community standards, and added a test to ensure that it's correct. 2010-02-22 18:48:22 -05:00
Eric Florenzano
3035f0adc8 Use PyFlakes to fix some fail 2010-02-22 16:47:10 -05:00
Mathieu Pillard
c364ca7aa1 Replace hashlib by django's md5_constructor 2010-02-22 16:36:55 -05:00
Eric Florenzano
2e55166df6 Fixed conflicts 2010-02-22 16:35:57 -05:00
Mathieu Pillard
ea8479d7bb Force thumbnail extension if AVATAR_HASH_FILENAMES is true. Avoids having
.jpg images that are really PNGs.
2010-02-22 16:33:56 -05:00
Mathieu Pillard
ce88c225ca Oops. 2010-02-22 16:33:14 -05:00
Mathieu Pillard
757283b823 Implement filename hashing (in case we don't want to blindly accept the filenames supplied by the user) and directory hashing (to allow
storage paths like /avatars/a/b/<user>/...)
2010-02-22 16:32:55 -05:00
Mathieu Pillard
aaeca7222e Thumbnails path simplification - /AVATAR_STORAGE_DIR/<user>/resized/<size>/<name> is enough. And this
method is more DRY, which will help when we'll implement the advanced storage path stuff
2010-02-22 16:32:22 -05:00
Mathieu Pillard
b2f3bec769 This time it should really work in every case... I hope. This really needs some unit tests. 2010-02-22 16:32:00 -05:00
Mathieu Pillard
2055adb46d This was needed too - basically, only enforce AVATAR_MAX_AVATARS_PER_USER in the form. 2010-02-22 16:31:36 -05:00