Questions tagged [django-imagekit]

Automated image processing for Django models.

ImageKit is a Django app that helps you to add variations of uploaded images to your models. These variations are called “specs” and can include things like different sizes (e.g. thumbnails) and black and white versions.

Documentation is available at https://django-imagekit.readthedocs.io/

140 questions
2
votes
1 answer

Django channels to resize an image

I have a model for Photo, with two image fields. One is for the original image and the other is for the resized version of the original image. class Photo(models.Model): user = models.ForeignKey(User) image_original = models.ImageField( …
Karl
  • 1,689
  • 3
  • 15
  • 23
2
votes
0 answers

django-imagekit get image height from template

In my template file i have: {% generateimage 'myapp:catalogitem' source=product.image -- class="itemimage" %} Style for this image: div.pricelist-item img.itemimage { float: left; max-width: 40mm; …
Mažas
  • 387
  • 1
  • 6
  • 19
2
votes
1 answer

Django ImageKit: add watermark and create thumbnail

I need to fit user's uploaded image to 1000px and put a watermark. Also I need to create thumbnail (without watermark). class Watermark(object): def process(self, img): draw = ImageDraw.Draw(img) draw.line((0, 0) + img.size,…
Alexander
  • 41
  • 1
  • 6
2
votes
1 answer

AttributeError: 'cStringIO.StringO' object has no attribute 'fileno' when using django-imagekit

I am using django-imagekit to process upload images, and I ran into the following error: AttributeError at /car/7/ 'cStringIO.StringO' object has no attribute 'fileno' Request Method: GET Request URL: …
JSNoob
  • 1,477
  • 2
  • 18
  • 31
2
votes
2 answers

django-imagekit compress image if image size is GT 300KB

I have managed to install (after a lot of effort) django-imagekit and I am now able to use django-imagekit to compress the file size of uploaded images. I can upload an image of 6MB and django-imagekit will compress the image to 230KB when I use a…
user1261774
  • 3,525
  • 10
  • 55
  • 103
2
votes
2 answers

Resizing image on upload with django-imagekit

I am using imagekit to handle custom size of uploaded images. While it works fine for creating custom size images with this, I'd like to use imagekit to resize the original image on upload. Is this possible?
kusut
  • 1,610
  • 14
  • 24
2
votes
1 answer

DJANGO ImageKit Functionality

I'm putting together a very basic time-lapse sequence of images (about 120 images total). I've installed imagekit, adjusted the specs.py file to my needs, populated the database with "pointers", imagekit has generated thumbnails.....all is well. …
Michael Moreno
  • 219
  • 2
  • 9
2
votes
2 answers

Django Imagekit overwrite cachefile_name?

I'm trying to overwrite the cachefile_name property from the module django-imagekit. Here is my code: class Thumb150x150(ImageSpec): processors = [ResizeToFill(150, 150)] format = 'JPEG' options = {'quality': 90} @property def…
nuss
  • 1,280
  • 2
  • 9
  • 12
2
votes
1 answer

How to clear imagekit cache

I'm using imagekit on S3 with a NonValidatingImageCacheBackend backend. I recently changed the sizes on one of my specs and realized that imagekit didn't regenerate new specs because the optimistic backend is blinding retrieving the old cached…
pseudosudo
  • 6,270
  • 9
  • 40
  • 53
1
vote
3 answers

Django Imagekit processing the original image

With version 1.1 I don't understand how I can preprocess the original image (by JUST using imagekit) https://github.com/jdriscoll/django-imagekit/blob/develop/README.rst Having a model like this: class Photo(models.Model): original =…
Hedde van der Heide
  • 21,841
  • 13
  • 71
  • 100
1
vote
1 answer

Django imagekit and dynamic paths

I'm using imagekit provided at: imagekit So, I've defined two class model: class Photo(models.Model): #photo_wrapper = models.ForeignKey(PhotoWrapper, blank=True, null=True) original_image = models.ImageField(upload_to='static/photos') …
M-S
  • 617
  • 7
  • 19
1
vote
1 answer

django-imagekit - add a static link to a default avatar picture

I'm using django-imagekit to get the image urls from a model called Avatar like this: views.py my_results = SearchQuerySet().all() try: user_avatar = Avatar.objects.filter(user__in=[x.object.user_id for x in my_results]) except…
avatar
  • 12,087
  • 17
  • 66
  • 82
1
vote
0 answers

How do I fill in the ProcessedImageField after saving the original image?

How do I fill in the ProcessedImageField after saving the original image? I tried to override the save method, smth like this: class A(models.Model): original = models.ImageField() webp_1x = ProcessedImageField(format='WEBP',…
Sh VavilenT
  • 337
  • 2
  • 9
1
vote
1 answer

Django ImageKit change image dimension inside Admin site

I use ImageKit to display images inside Django Admin site and it works fine: @admin.register(Client) class ClientAdmin(admin.ModelAdmin): list_display = ['title', 'client_logo', ] client_logo = AdminThumbnail(image_field='logo') …
Omid Shojaee
  • 333
  • 1
  • 4
  • 20
1
vote
0 answers

Django tries to serve cached image that does not exist

I'm running django 1.7.1 I'm trying to render a .html page that makes used of some cached images. This is the Image model that these images belong too: image_pbox = models.ImageField( …
Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64
1 2
3
9 10