Commit graph

108 commits

Author SHA1 Message Date
satya-waylit
80a7c95583
Close files in create thumbnail (#252)
* Close the orig file in `create_thumbnail` method

* Skip python-magic tests on windows

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Johannes Wilm <mail@johanneswilm.org>
2026-01-07 22:03:47 +01:00
Petr Dlouhý
2687d6cd06
add support for Django STORAGES (#237)
* add support for Django STORAGES

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Johannes Wilm <mail@johanneswilm.org>
2023-10-16 11:36:03 +02:00
Johannes Wilm
c089561f48 add test for nondefault image names, fixes #38 2022-08-16 13:40:25 +02:00
Johannes Wilm
39f8681e29 Use correct extension for thumbnails, fixes #54 2022-08-16 13:28:09 +02:00
Johannes Wilm
0e09d40bf1 Correct thumbnail transposing for Safari, resolves #207 2022-08-16 11:55:31 +02:00
Johannes Wilm
d0ed3e3132 additional magic test 2022-08-15 12:03:54 +02:00
Johannes Wilm
28302c5205 Add invalidate_cache test 2022-08-15 11:34:35 +02:00
Johannes Wilm
198946a8af Merge branch 'master' of github.com:iMaGiNiX/django-avatar into iMaGiNiX-master 2022-08-15 10:17:24 +02:00
Johannes Wilm
99a979b057
rectangular avatars (#214)
* Support for rectangular avatars

* fix tests

* Add rectangle size test

* Update documentation and changelog

* add test for exposing username (or not)

* add primary_avatar_tag tests

* make rebuild_avatars, remove_avatar_images work with rectangles + tests

* Python 2 => 3

* fix tests

Co-authored-by: Karl Moritz Hermann <karlmoritz.hermann@gmail.com>
2022-08-15 10:08:35 +02:00
Rafiq Hilali
8017d6fc4c
Delete avatars from file storage when avatar is deleted (#174)
* added custom delete method to Avatar model inorder to delete avatars from file storage

* simplified chained expression to pass linting

* linting

* stopped using reserved keyword dir

* changed remove_avatar_images so it deletes all generated avatars

* went back to using queryset delete

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Johannes Wilm <mail@johanneswilm.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-14 13:03:45 +02:00
Johannes Wilm
58aa1261ad always convert JPEG/RGBA to JPEG/RGB 2022-08-11 08:36:24 +02:00
Johannes Wilm
2fb3034505 make AVATAR_THUMB_MODES configurable, solves #153, #180 2022-08-10 19:02:07 +02:00
Johannes Wilm
5452d4ea34 Merge branch 'eureka_pub' of github.com:caumons/django-avatar into caumons-eureka_pub 2022-08-10 17:53:32 +02:00
Johannes Wilm
6ccc046386 fix error type 2022-08-09 21:25:00 +02:00
Johannes Wilm
a977753b2c lint and add pre-commit configuration 2022-08-09 21:17:24 +02:00
Johannes Wilm
6ba1280a7e remove six 2022-07-16 23:25:43 +02:00
Johannes Wilm
8f94d125b3 switch to github actions 2022-07-16 23:02:49 +02:00
Johannes Wilm
ae950c9b50 black 2022-07-16 22:50:05 +02:00
Johannes Wilm
a131861589 Merge branch 'django4.0' of github.com:johanneswilm/django-avatar 2022-07-16 22:27:50 +02:00
Johannes Wilm
03c95bc925 update imports 2022-07-16 22:26:58 +02:00
Nicholas H.Tollervey
68340e8ac6
Update to work with Django 4.0. Based upon PR #201. 2022-01-27 18:41:45 +00:00
Johannes Wilm
53b7fa2265
use original file as default
If thumbnail creation fails but the original files could be read, save the original file as the thumbnail.
2020-03-02 18:47:00 +01:00
Grant McConnaughey
ce56f6a104
Merge pull request #177 from rafiqhilali/avatar-deletion-storage-bug
Avatar storage deletion bug
2020-01-04 11:41:27 -06:00
bastb
2793ff0830 Fixes the Django 3.0 six issue 2019-12-03 08:16:14 +01:00
Rafiq Hilali
15879af5ce fixed storage deletion bug 2019-02-11 17:12:11 +00:00
Ricardo Garcia Silva
a26a133d9d
use the lazy version of gettext for translating models 2018-07-02 12:08:00 +01:00
Grant McConnaughey
2de2a60e85 Fix conflicts 2017-12-17 10:24:02 -06:00
Clement Cavanier
69901569a3 Support for Django 2 2017-12-06 15:06:45 +01:00
Grant McConnaughey
f8716937b0 Prevented creation of the new migrations with non-default DEFAULT_FILE_STORAGE 2017-08-27 08:45:45 -05:00
Arne Holzenburg
341732a38c 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.
2017-07-11 14:42:55 +02:00
Jannis
6091dd90fe Add blank line to resolve failing PEP8 check. 2017-05-27 09:50:47 -05:00
Jannis
112141a457 Add verbose_names to Avatar model. 2016-09-16 10:55:13 +02:00
Grant McConnaughey
5cbd095cda Rename util -> utils, fix URL issue 2016-02-09 09:42:29 -06:00
Grant McConnaughey
a6b4c2beea Merge pull request #75 from z4r/patch-1
Preserve RGBA image.mode
2016-02-09 09:17:52 -06:00
Grant McConnaughey
c2a5cec2bf Added documentation for new settings 2016-02-09 09:06:16 -06:00
Grant McConnaughey
b10197ac5a Merge pull request #105 from barbuza/master
`EXPOSE_USERNAMES` prevents sensitive information leakage
2016-02-09 08:46:17 -06:00
Kaspars Sprogis
cdb7974054 New setting to specify path to a method for avatar file path
handling. Solves problems related to custom deployments and
directory paths: #10 #9.
2016-02-08 22:01:12 +02:00
Victor Kotseruba
0aaa59e0a7 RANDOMIZE_HASHES option 2016-01-18 18:57:41 +08:00
Grant McConnaughey
a258377207 Revert unique user/primary pair 2015-10-23 09:33:10 -05:00
Danny Browne
1c56ed5dbc added database-level enforcement of unique user+primary pair in Avatar model 2015-09-04 12:58:32 -04:00
Kaloian Minkov
97b1ffd020 Add Django 1.8+ style Meta app_label to Avatar model to prevent RemovedInDjango19Warning 2015-07-23 11:23:33 +03:00
Victor Kotseruba
1197dbe739 EXPOSE_USERNAMES prevents sensitive information leakage 2015-06-12 01:33:20 +03:00
Igor Mella
d7db61b275 Prevent thumbnails clones
To prevent the creation of multiple thumbnails clones "fileName.hash.ext"
2015-01-11 17:49:10 -03: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