Matthew Tretter
bdec396180
Support inner Config class for id, sources
...
Closes #164
2012-10-24 22:23:53 -04:00
Matthew Tretter
8d3fcafcd9
Swap argument order for specs.register
...
This will allow us to put the id in the inner Meta class.
2012-10-24 22:14:45 -04:00
Matthew Tretter
d110b82347
Rename imagekit_tags to imagekit
2012-10-21 17:59:56 -04:00
Matthew Tretter
3dbb96ea40
Remove unused imports
2012-10-21 17:57:53 -04:00
Matthew Tretter
3e2c3803ff
No need to call spec; the registry does that
2012-10-20 23:44:26 -04:00
Matthew Tretter
0c4d9738c6
Add TODO
2012-10-20 23:44:13 -04:00
Matthew Tretter
12493b3a0d
Spec host must support kwarg "hints"
...
The registry's `get_spec()` was already supporting kwargs as a means to
provide information about the source to the spec constructor/factory
function, but the ``SpecHost`` class wasn't capable of accepting any.
This commit rectifies that. The main goal purpose of this is to allow a
bound field (the file attached by ``ImageSpecFileDescriptor``)--and the
attached model instance--to be taken into account during the spec
instance creation.
Related: #156
2012-10-20 23:29:07 -04:00
Matthew Tretter
aa91a70e46
Make specs know less about source files
2012-10-20 22:53:55 -04:00
Matthew Tretter
e796b4cc61
Create ImageSpec subclasses
...
Since the `ImageSpec` constructor will be accepting keyword arg hints,
it can no longer accept the properties.
2012-10-20 22:15:25 -04:00
Matthew Tretter
b0b466618f
Separate two forms of tag; support additional html attrs
...
Closes #154
2012-10-17 23:41:34 -04:00
Matthew Tretter
770a8cebf4
Fix iteration error
2012-10-17 21:35:19 -04:00
Matthew Tretter
e300ce36a4
Use new registry name
2012-10-17 21:25:19 -04:00
Matthew Tretter
4f52e401d2
Handle null format
2012-10-17 21:24:57 -04:00
Matthew Tretter
98a6fff62d
Add DEFAULT_FILE_STORAGE Setting; Closes #153
2012-10-17 21:09:04 -04:00
Matthew Tretter
ca1db05c4e
Use named logger
2012-10-17 21:00:32 -04:00
Matthew Tretter
d8ce11e86e
Log warning when filename doesn't match expected value
2012-10-17 01:11:05 -04:00
Matthew Tretter
806ebd75b6
Don't return file from generate()
...
The file is `self`
2012-10-17 00:37:02 -04:00
Matthew Tretter
ca324b7f52
Remove unused import
2012-10-17 00:32:31 -04:00
Matthew Tretter
41fa197212
Remove save kwarg--that's what generate() does!
2012-10-17 00:31:38 -04:00
Matthew Tretter
a08edaca56
Handle storage in BaseIKFile
2012-10-17 00:29:51 -04:00
Matthew Tretter
97d47c9c6c
Remove generate_file. apply() does it all!
...
There was a lot of garbage in that method and I don't know why.
2012-10-17 00:23:38 -04:00
Matthew Tretter
77b33f757c
Correct example
2012-10-17 00:07:29 -04:00
Matthew Tretter
4c4727fa9f
Remove unused import
2012-10-17 00:07:29 -04:00
Matthew Tretter
63ad9e4421
Remove registration methods from template tag
...
The registry isn't just for template tags anymore.
2012-10-17 00:07:28 -04:00
Matthew Tretter
a93832626a
Return string from render method
...
...instead of wrapping the file with an object that has a __unicode__
method. If you want the actual file, you should use the assignment form.
2012-10-17 00:07:23 -04:00
Matthew Tretter
9b81acd10c
Don't pass removed argument
2012-10-16 23:52:31 -04:00
Matthew Tretter
5c6d1aef5d
Rename ImageSpecFile
...
You can generate other "spec" files (using apply will get you one). This
one is for saving cache files and its name should reflect that.
2012-10-16 23:51:26 -04:00
Matthew Tretter
df8905f7e4
Remove unused imports
2012-10-16 23:39:10 -04:00
Matthew Tretter
738bbfa9a1
Move cache file naming into ImageSpecFile
2012-10-16 23:38:44 -04:00
Matthew Tretter
5ca8b7f4ba
Rename process_file; don't return image object
...
This function will just be used to apply the spec and create a new file;
useful for transforming images in views, etc.
2012-10-16 22:59:40 -04:00
Matthew Tretter
fdc08aeeb0
Don't extend ImageFieldFile
...
This file isn't just for fields anymore, so we want to get rid of all
the ORM stuff.
2012-10-16 22:52:01 -04:00
Matthew Tretter
13b59ef85e
Reorder methods
2012-10-16 22:33:17 -04:00
Matthew Tretter
a4ef8aa681
Add before_access signal
2012-10-16 22:30:36 -04:00
Matthew Tretter
3308c92a71
Remove SpecWrapper class
...
We don't need it now that we have an ImageSpec class
2012-10-16 22:23:14 -04:00
Matthew Tretter
37e0de3069
Move signals module
2012-10-16 22:10:52 -04:00
Matthew Tretter
8ef1437bea
Remove apply() method
2012-10-16 22:06:24 -04:00
Matthew Tretter
1452f04cda
Remove unused parameter
2012-10-16 22:03:50 -04:00
Matthew Tretter
7f6e97a37a
Rename Pessimistic to JustInTime
2012-10-16 21:46:23 -04:00
Matthew Tretter
ca391fbf0a
Change cache prefix
2012-10-16 21:43:17 -04:00
Matthew Tretter
80b723b510
Move IKContentFile to imagekit.files
2012-10-16 21:31:47 -04:00
Eric Eldredge
c0b79a227d
Remove ImageSpecFieldFile in favor of ImageSpecFile
2012-10-15 23:53:05 -04:00
Eric Eldredge
2a33a2ad88
Fix circular import utils > imagecache.backends
2012-10-15 21:17:58 -04:00
Eric Eldredge
93409c8f05
SpecRegistry's spec can be callable (spec factory)
2012-10-14 21:35:07 -04:00
Eric Eldredge
461fbaef1a
Processors no longer callable
2012-10-14 18:48:17 -04:00
Matthew Tretter
dc84144d6b
Pass additional info with source signal
2012-10-14 16:08:48 -04:00
Matthew Tretter
7ce05f468a
Pass attname to dispatch_signal
...
This allows any file object to be used--even those that don't have a
`field` attribute. For example, you could theoretically use one spec
field as a source for another.
2012-10-14 15:41:35 -04:00
Matthew Tretter
7447d147d4
Wire up source events to specs (and image cache strategies)
...
Also change signal names to past tense to match convention.
2012-10-13 01:16:05 -04:00
Matthew Tretter
cedd744e32
Add description of registry
2012-10-13 00:22:30 -04:00
Matthew Tretter
440fcb19ef
Correct signal relaying
2012-10-12 23:43:51 -04:00
Matthew Tretter
a59330cf2c
Add class description
2012-10-12 23:12:05 -04:00
Matthew Tretter
8a35b3a3dd
Registration and connection of sources
2012-10-12 23:08:26 -04:00
Matthew Tretter
fe803f8981
Beginning to move functionality into "sources"
...
Before this is applied, we're going to have to make it so that the
image cache strategies are passed the source file, not the other file.
2012-10-10 00:18:54 -04:00
Matthew Tretter
06e5f45904
Remove unused imports
2012-10-04 23:43:02 -04:00
Matthew Tretter
667f0cc08e
Simplify IMAGEKIT_CACHE_BACKEND setting
2012-10-04 23:41:20 -04:00
Matthew Tretter
436a73dc9a
Remove image cache backend field registration
2012-10-04 23:28:55 -04:00
Matthew Tretter
5a1dd0c459
Don't require spec to be created up-front
2012-10-04 23:27:19 -04:00
Matthew Tretter
ce08448207
Rename register_spec() to set_spec_id()
2012-10-04 23:22:25 -04:00
Matthew Tretter
56c66f4883
Back ProcessedImageField with spec registry
2012-10-04 23:15:16 -04:00
Matthew Tretter
82d0e4be73
Remove unused imports
2012-10-04 23:03:22 -04:00
Matthew Tretter
f289ff3199
Back ImageSpecFields with spec registry
...
This marks a major step towards centralizing some of the "spec" logic
and creating a single access point for them. Because `ImageSpecFields`
are just alternative interfaces for defining and registering specs,
they can be accessed and overridden in the same manner as other specs
(like those used by template tags): via the spec registry.
2012-10-04 22:56:26 -04:00
Matthew Tretter
99ba61d605
Move spec registry
2012-10-04 22:02:29 -04:00
Matthew Tretter
116b0bc0c5
Move spec classes to specs module
2012-10-04 21:58:22 -04:00
Matthew Tretter
30ba1d890e
Move exceptions
2012-10-04 21:57:33 -04:00
Matthew Tretter
0cc7938400
Re-integrate receivers module
...
Somewhere along the line, a change got merged that stopped using the
receivers module. This re-integrates it and moves changes made to the
old receivers (static methods on ImageSpecField) to them.
2012-10-04 21:44:55 -04:00
Matthew Tretter
d2087aa168
Create ImageSpecs; remove generators
2012-10-04 21:37:20 -04:00
Eric Eldredge
2e5489eb56
Merge branch 'ik-next' into templatetags
...
Conflicts:
imagekit/models/fields/__init__.py
imagekit/utils.py
2012-10-04 15:46:50 -04:00
Matthew Tretter
c8778b9cfb
Remove print statement
2012-10-03 22:31:45 -04:00
Matthew Tretter
ba9bf1f877
Add image cache strategies
...
This new feature gives the user more control over *when* their images
are validated. Image cache backends are now exclusively for controlling
the *how*. This means you won't have to write a lot of code when you
just want to change one or the other.
2012-10-03 22:23:11 -04:00
Matthew Tretter
f43bd4ec28
Include source filename in hash
2012-09-15 15:09:58 -04:00
Eric Eldredge
ec9a1f1fda
Spec templatetag returns html by default
...
...if no 'as var' is provided or if the var is printed directly.
2012-09-07 00:25:03 -04:00
Matthew Tretter
8a2738ca8a
Add backend for caching image state
2012-09-06 22:11:23 -04:00
Matthew Tretter
2ad3791d9d
Reorganize image cache backends
2012-09-06 09:11:18 -04:00
Matthew Tretter
3103ab29bd
Remove "non-validating" backend
...
It's been superseded by the VALIDATE_ON_ACCESS setting
2012-09-06 09:10:05 -04:00
Matthew Tretter
0fc29ee7cf
Extract useful backend utils
2012-09-06 09:09:30 -04:00
Matthew Tretter
197dfb3485
Add VALIDATE_ON_ACCESS setting
2012-09-06 09:08:45 -04:00
Eric Eldredge
bdecf75e0a
Merge branch 'ik-next' into templatetags
2012-09-05 21:47:39 -04:00
Eric Eldredge
c50e6cea3b
Merge branch 'develop' into templatetags
...
Conflicts:
imagekit/utils.py
2012-09-05 21:46:59 -04:00
Matthew Tretter
c8733c4707
Change how signals are used
...
Signals are now connected without specifying the class and non-IK
models are filtered out in the receivers. This is necessary because of
a bug with how Django handles abstract models.
Closes #126
2012-07-25 23:04:21 -04:00
Matthew Tretter
23c6e9a70e
Add __init__ to Reflection processor; closes #141
2012-07-25 22:20:15 -04:00
Matthew Tretter
7ad5cf4db5
Use hashes for generated image filenames
...
While this change means users can no longer specify their own filenames,
changing a property of a processor, for example, will now result in a
new image. This solves a lot of the previous invalidation issues.
2012-07-19 23:48:28 -04:00
Matthew Tretter
a196e00059
Use django-appconf
2012-07-19 21:03:15 -04:00
Matthew Tretter
548fb65618
Allow callables for AdminThumbnail image_field arg
...
This allows images from related models to be displayed. Closes #138 .
2012-07-19 20:08:03 -04:00
Matthew Tretter
becee54c03
Fix pickling of ImageSpecFieldFile
...
Code now passes the test added in 118f6e4 . Hopefully this will
address #97 .
2012-07-18 22:25:26 -04:00
Matthew Tretter
c1b4c9bf71
Use cStringIO if available
2012-05-12 15:45:08 -04:00
German M. Bravo
89f2aa7a7d
Reflections on images using RGBA
2012-05-12 15:39:36 -04:00
German M. Bravo
784afcc95d
Simplified path join for the cache
2012-05-12 15:39:12 -04:00
Bryan Veloso
322c96eec2
Merge branch 'release/2.0.1' into develop
...
* release/2.0.1:
Bumping the version number.
Changelog update.
2012-04-28 11:32:22 -07:00
Jeroen Dekkers
69b590257d
Do not leak file descriptor
2012-04-28 16:13:50 +02:00
Bryan Veloso
209afac9e3
Merge branch 'develop' into release/2.0
...
* develop:
IKContentFile accepts format hint
Additional mimetype utils
Don't get extension of empty filename
Tell people to import fields from the models module
Refactored AutoConvert into prepare_image
Docstring for save_image
Kill PIL's chattiness; fixes #91
PIL bug workaround
Use StringIO instead of temp file
Extract reusable save_image function
Rename SpecFile and move it to utils
Extract suggest_extension util from generator
Woah, globals
Add SpecFile.__unicode__
2012-04-24 13:59:28 -07:00
Matthew Tretter
89eb05668e
IKContentFile accepts format hint
2012-04-20 23:30:30 -04:00
Matthew Tretter
b466ff3723
Additional mimetype utils
2012-04-20 23:27:35 -04:00
Matthew Tretter
7b34716d9e
Don't get extension of empty filename
2012-04-20 23:26:58 -04:00
Matthew Tretter
af7c12cb68
Tell people to import fields from the models module
2012-04-20 21:43:59 -04:00
Matthew Tretter
667e265c94
Refactored AutoConvert into prepare_image
...
Because of its need to return kwargs for ``Image.save()``, it never
really fit the mold of a processor.
2012-04-20 21:37:43 -04:00
Matthew Tretter
222c9ba22a
Docstring for save_image
2012-04-20 21:23:06 -04:00
Matthew Tretter
b6f629d644
Kill PIL's chattiness; fixes #91
2012-04-20 01:55:00 -04:00
Matthew Tretter
5fdf9d6a91
PIL bug workaround
2012-04-20 00:46:35 -04:00
Matthew Tretter
6f8a22c5bf
Use StringIO instead of temp file
2012-04-20 00:46:33 -04:00
Matthew Tretter
e0c9708e63
Extract reusable save_image function
2012-04-20 00:46:08 -04:00
Matthew Tretter
7d5937ebe6
Rename SpecFile and move it to utils
2012-04-19 21:33:56 -04:00