Commit graph

39 commits

Author SHA1 Message Date
Eric Eldredge
8a0bc084fe Processors no longer take a file argument.
They only get the image to process now.
2011-09-23 21:25:47 -04:00
Matthew Tretter
7e20b75ced Processors don't care about format.
The process of choosing an image format has been cleaned up and
Processors' role in determining the format has been removed.

Previously, processors would return a tuple containing the modified
image and the format. Other parts of IK overrode PIL's Image.format
with the target format, although that had no effect on PIL and the fact
that it didn't throw an error was just lucky.
2011-09-23 20:18:51 -04:00
Matthew Tretter
15e49be719 Extracted ProcessorPipeline
Pulled some functionality out of _ImageSpecMixin into the ProcessorPipeline
class so it could be used independently of the model-related stuff.
2011-09-23 19:12:04 -04:00
Matthew Tretter
e190e78df5 Rename fields module to models. 2011-09-23 18:06:28 -04:00
Matthew Tretter
fb53981ec8 No need to extend ImageModel.
In fact, ImageModel doesn't exist anymore. Most of IKOptions have also been
removed.
2011-09-21 21:15:09 -04:00
Matthew Tretter
7167016237 Removed specs list from opts. 2011-09-21 20:21:48 -04:00
Matthew Tretter
4e23254e73 Crop processor accepts anchor argument. 2011-09-21 19:02:18 -04:00
Matthew Tretter
b5616d2f75 Move ImageSpec to fields module. 2011-09-21 11:37:29 -04:00
Eric Eldredge
b1c5432310 Implemented post_save and post_delete handlers for ImageSpecs.
Removed the save and clear_cache methods from ImageModel (along with helpers).
Now, whenever an ImageSpec is contributed to a model, handlers are created for
the post_save and post_delete signals. The post_save handler does the work of
running the ImageSpec processors and caching the resulting file, while the
post_delete handler does the work cleaning up the cached files.
2011-09-21 09:56:27 -04:00
Matthew Tretter
80c785f2e5 No need for this. 2011-09-20 21:03:34 -04:00
Matthew Tretter
544d5b874a Added AdminThumbnailView field.
You're no longer restricted to just one, special-case admin thumbnail. Make as
many as you want by adding AdminThumbnailView properties to your model and
including them in your admin class's `list_display` tuple. You can also provide
a custom template. Note that (because this change introduces templates to
imagekit), imagekit is now required in INSTALLED_APPS.

Ideally we could get this stuff out of the model, but we'll have to look into
whether that's possible without making things really complicated.
2011-09-20 19:37:04 -04:00
Matthew Tretter
501d3c7ad3 Now using contribute_to_class.
By creating the Descriptor using contribute_to_class (instead of in
ImageModelBase's __init__), we take the first step towards eliminating the need
to extend ImageModel at all.
2011-09-20 15:44:54 -04:00
Matthew Tretter
57a28091c5 Added default_image_field
This works kind of like Django's models' _default_manager. If your specs don't
specify an image_field, and your IKOptions don't specify a default_image_field,
the first ImageField your model defines will be used.
2011-09-10 00:25:27 -04:00
Matthew Tretter
4c78f2d24c _imgfield is now a property of ImageSpec
Moved _imgfield from ImageModel to ImageSpec. Theoretically, this will allow you
to have specs that use different image fields on the same model.
2011-09-10 00:24:37 -04:00
Matthew Tretter
5e00de5204 Admin thumbnails. 2011-09-10 00:23:47 -04:00
Matthew Tretter
def8dea23f Storage moved onto ImageSpec. 2011-09-08 10:28:54 -04:00
Matthew Tretter
a9895f335a Using spec properties from ImageModel. 2011-09-08 10:00:22 -04:00
Matthew Tretter
2387cc4be2 Added ability to specify specs in IKOptions directly. 2011-09-02 23:35:58 -04:00
Bers
aa348d76f6 fix issue #12 2011-07-04 04:09:31 -07:00
Bryan Veloso
f777c08b17 Whitespacing. 2011-03-26 00:46:17 -07:00
Jonathan Slenders
57ef4748b9 fixed 'sender' not defined bug (2) 2011-03-26 15:40:22 +08:00
Jonathan Slenders
53cddf7752 fixed 'sender' not defined bug 2011-03-26 15:40:21 +08:00
Bryan Veloso
ad3f15ef76 Instead of overriding Model.delete(), we'll connect a public clear_cache() method to a post_delete() signal so that bulk actions clean props as well. 2011-02-23 12:54:09 -08:00
Bryan Veloso
90dab6c8a1 Don't pre_cache if we don't have an image. 2011-02-10 16:56:31 -08:00
Justin Driscoll
7076e520f7 Fixed type 2010-06-12 15:05:31 -04:00
Justin Driscoll
ec83074cee ImageKit should now support optional imagefields better now. 2010-06-12 15:03:59 -04:00
Justin Driscoll
125c2c1470 Cleaned up trailing whitespace 2009-12-19 11:01:54 -05:00
Ben Jackson
26f01721df Add IKOption.storage to explicitly set cached thumbnail storage.
Original image storage is still the default, and the original image
is always read from its own storage.
2009-12-17 22:26:19 -08:00
Justin Driscoll
f28683dd0f Fixed indentation error 2009-09-14 14:51:29 -04:00
Justin Driscoll
fa6659162c Added 'replace' argument to save_image 2009-09-02 14:26:30 -04:00
Justin Driscoll
bc4ff39e9e Added save_image method to ImageModel 2009-09-02 14:20:30 -04:00
Justin Driscoll
77e953edcb Escaped urls in admin_thumbnail 2009-08-31 17:00:38 -04:00
Justin Driscoll
7a04da81e1 Updated preprocessor implementation 2009-07-19 13:50:31 -04:00
Justin Driscoll
486f602aa2 Merged changes 2009-04-19 13:50:34 -04:00
Justin Driscoll
9c455a19c5 Fixed a couple issues with having an optional (and empty) image field in an ImageModel 2009-04-19 13:46:01 -04:00
Justin Driscoll
cc5c846c0a Fixed check in admin_thumbnail_view 2009-03-13 13:14:53 -04:00
Justin Driscoll
e03edf8e83 admin_thumbnail_view no longer crashes when there is no file found 2009-03-13 12:35:33 -04:00
Justin Driscoll
e0a2ad9ede Added crop choice tuples and tweaked a couple of comments 2009-03-03 11:44:51 -05:00
Ariel Nunez
920bf47128 Added setup.py and relocated source dir 2009-02-02 15:46:41 -05:00
Renamed from src/imagekit/models.py (Browse further)