Commit graph

620 commits

Author SHA1 Message Date
Venelin Stoykov
2c85d5aafe Do not check for existence if name is None
This will fix tests for Django master
2018-10-12 23:06:28 +03:00
Venelin Stoykov
6f7de35f79
Merge pull request #469 from matthewwithanm/fix-image-cachefile-serializtion
Fix pickle serialization for ImageCacheFile
2018-06-03 18:21:48 +03:00
Roman Gorbil
de991d4048 Fix pickle serialization for ImageCacheFile
When Celery CachedFileBackend used with filesystem storage (django.core.files.storage.FileSystemStorage), everything works fine.
But there are issues with storages.backends.s3boto3.S3Boto3Storage (and it's fix from #391), as well as with django_s3_storage.storage.S3Storage.

Exception was:

```
Traceback (most recent call last):
  ...

  File "/src/django-imagekit/imagekit/cachefiles/__init__.py", line 131, in __bool__
    existence_required.send(sender=self, file=self)
  ...
  File "/libs/utils.py", line 380, in on_existence_required
    file.generate()
  File "/src/django-imagekit/imagekit/cachefiles/__init__.py", line 94, in generate
    self.cachefile_backend.generate(self, force)
  File "/src/django-imagekit/imagekit/cachefiles/backends.py", line 136, in generate
    self.schedule_generation(file, force=force)
  File "/src/django-imagekit/imagekit/cachefiles/backends.py", line 165, in schedule_generation
    _celery_task.delay(self, file.generator, force=force)
  ...
  File "/lib/python3.6/site-packages/kombu/serialization.py", line 221, in dumps
    payload = encoder(data)
  File "/lib/python3.6/site-packages/kombu/serialization.py", line 350, in pickle_dumps
    return dumper(obj, protocol=pickle_protocol)
kombu.exceptions.EncodeError: can't pickle _thread._local objects
```
2018-06-03 18:06:57 +03:00
Leonardo
595f7b35ef Enhance condition in _get_size (#463)
This fix the issue #326.
2018-04-24 15:48:43 +03:00
Venelin Stoykov
ea66e3d10d Bump version to 4.0.2 2017-11-20 10:24:12 +02:00
Venelin Stoykov
6319891697
Merge pull request #440 from matthewwithanm/fix/open-files-leak
Fixed #429 Do not leak open files after generation
2017-11-20 10:02:01 +02:00
Venelin Stoykov
6ee931398f Do not leak open files after generation 2017-11-17 18:37:54 +02:00
Roman Gorbil
d80f426d3c Fix ImageCacheFile.__repr__ to not send signals
Cachefile strategy may be configured to generate file when file existance required.

To generate images, async backends passes `ImageCacheFile` instance to worker.
Both celery and RQ calls `__repr__` method for each argument to enque call.
And if `__repr__` of object will send `existnace_required` signal, we will get endless recursion.

Issue: #434
2017-10-10 17:39:46 +07:00
Yuri Kanivetsky
de3047e73d Make generateimages support pre Django 1.8 versions 2017-09-12 20:46:24 +03:00
Yuri Kanivetsky
a153812add generateimages: fix taking arguments 2017-08-29 11:27:10 +03:00
Venelin Stoykov
2b04099dc4 Fixed #368 use specs directly in ProcessedImageField
Thanks to @xcono for pointing to solution to the problem
2017-05-18 23:38:32 +03:00
Venelin Stoykov
f96dadbfe0 Bump version to 4.0.1 2017-05-17 17:45:22 +03:00
Moritz Pfeiffer
36fa53e249 Cleaned up _autodiscovered flag handling. 2017-05-17 09:51:24 +02:00
Moritz Pfeiffer
c74d8424b8 Added huge performance improvement by running imagekit.utils.autodiscover() only once on Django > 1.7 as it was intended. 2017-05-16 14:19:05 +02:00
Venelin Stoykov
46d2a9e663 Bump version to 4.0 2017-02-22 15:35:20 +02:00
Venelin Stoykov
16ab0d2c99 Merge pull request #412 from vstoykov/feature/appconfigs-module-loading
Replaces #301 autodiscover works with AppConfig
2017-02-22 15:13:14 +02:00
Venelin Stoykov
755193699b Replaces #301 autodiscover works with AppConfig 2017-02-22 14:21:09 +02:00
Venelin Stoykov
2bc6241f55 Do not try south modelinspector when not needed
Fixed #408
2017-02-21 15:19:40 +02:00
Venelin Stoykov
3546c39178 Merge pull request #403 from vstoykov/improve/caching
Improve caching (By default cache files state "forever")
2017-02-17 14:35:05 +02:00
Venelin Stoykov
4d1ee41f2e Make it possible to configure IMAGEKIT_CACHE_TIMEOUT
By default cache forever
2017-02-17 02:47:19 +02:00
rohit suri
732f7045e4 Close the file only if it has been opened locally 2017-02-15 21:24:32 -08:00
Venelin Stoykov
95e484d073 Cleanup caching configuration
Requires Django 1.3+
2017-02-09 00:43:08 +02:00
Hannes Tismer
f1f295e054 honor post_save's update_fields and only fire the source_saved signal when needed 2016-10-24 16:21:53 +02:00
Venelin Stoykov
d86ec082f1 Fixed #350: Error when trying to access width/height after url
If the file is closed and something is calling `open` now the file will be opened correctly event if it was already closed
2016-07-17 05:08:01 +03:00
Venelin Stoykov
07d29b3bf7 Fixes #382: Tests no longer leave junk 2016-07-17 04:54:03 +03:00
Venelin Stoykov
5cde74e3e2 Fixes #379 Support for Django 1.10 2016-07-11 01:59:32 +03:00
Venelin Stoykov
340e26cd67 Move compat module outside of templatetags package 2015-12-26 17:58:22 +02:00
Bryan Veloso
7903efd9b7 Add @vstoykov to the author list. 2015-12-08 11:39:03 -08:00
Bryan Veloso
53fb3a8722 Bump version number. 2015-12-08 11:38:39 -08:00
Pierre Dulac
97dc4b6cb2 Work a compatibility implementation for Django 1.2 2015-10-31 18:51:07 +01:00
Pierre Dulac
5855e97997 Cleaner implementation thanks to @vstoykov explanation 2015-10-30 16:23:28 +01:00
Pierre Dulac
e155b632cd Handle cases where DEFAULT_CACHE_ALIAS is None in old Django versions 2015-10-30 00:24:50 +01:00
Pierre Dulac
fbf15befb8 Do not take a decision on which cache to use in DEBUG mode
maybe the developer wants to test his cache configuration locally, or
maybe he has to test different types of caches, we just don't know
2015-10-29 23:27:02 +01:00
Pierre Dulac
0a0708d2d6 Use a compat method to wrap the new way of retrieving the cache engine 2015-10-29 23:03:48 +01:00
Bryan Veloso
75763b80f8 Bump the version to 3.2.7. 2015-08-23 17:58:46 -07:00
Igor
7cdda46070 Fixes open cache file never getting closed
In a processes that generates many images, you could run into a
cituation with too man files being open. This results in:
IOError: [Errno 24] Too many open files
2015-08-02 00:05:43 -07:00
Igor
eb81b9c88c Fixes open source file never getting closed
In a processes that generates many images, you could run into a
cituation with too man files being open. This results in:
IOError: [Errno 24] Too many open files
2015-08-02 00:01:30 -07:00
Bryan Veloso
d6bbff47f0 Bump the version to 3.2.6. 2015-02-26 10:28:38 -08:00
ILYA
41f45a4fe7 Updated importlib import to fix DeprecationWarning (for django 1.8) 2015-02-26 10:28:11 -05:00
Bryan Veloso
a159e7c75b Bump the version to 3.2.5. 2015-01-05 15:58:38 -08:00
Niklas A Emanuelsson
d9fe8d24b2 Explicitly setting serializer for celery task 2015-01-02 15:40:40 +01:00
Bryan Veloso
1d5606b3d7 Bump the version to 3.2.4. 2014-09-28 13:23:32 -07:00
Matthew Dapena-Tretter
7f40d4fd4b Merge pull request #291 from danxshap/import_fix
Fix a Django 1.7 issue with importing INSTALLED_APPS modules
2014-09-28 16:06:16 -04:00
Venelin Stoykov
1ac3399737 Deprecate imagekit.processors submodules
- `base`, `crop`, `resize`, and `utils` are now placed in `pilkit` app
- remove magic compatibility between `imagekit.processors` and `pilkit.procesors`
2014-09-28 18:31:33 +03:00
Bryan Veloso
5f4f7070f4 Bump the version to 3.2.3. 2014-09-27 22:20:40 -07:00
Matthew Dapena-Tretter
78a1ccaf2f Only include fetched fields in initial hash of sources
Should avoid unnecessary queries, as detailed in GH-295.
2014-09-26 22:33:16 -04:00
Matthew Dapena-Tretter
00b4388245 Support should_verify_existence on strategies
This prevents extra IO. Different defaults are used for async backends
since we can’t assume that `existence_required` resulted in existence
synchronously.
2014-09-23 18:41:09 -04:00
danxshap
06b06dbced Catch autodiscover module import error 2014-09-08 18:28:49 -04:00
Bryan Veloso
d013b82c7f Bump version to 3.2.2. 2014-07-14 12:24:05 -07:00
Colin Wood
2f7bfe5dc7 Make sure image files has a name associated.
The generate image command will run into issues if the ImageSpecField does not
have any image file source associated wit hti. Like a Optional image field. So
we can not generate the images for that. So this should check to make sure that
it has one.
2014-07-11 10:07:43 -04:00