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
```
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
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
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
- `base`, `crop`, `resize`, and `utils` are now placed in `pilkit` app
- remove magic compatibility between `imagekit.processors` and `pilkit.procesors`
This prevents extra IO. Different defaults are used for async backends
since we can’t assume that `existence_required` resulted in existence
synchronously.
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.