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
3
votes
1 answer

I/O operation on closed file: Django Imagekit & Pillow

I am using django imagekit and pillow to upload images which was working fine in django 1.7. Recently we shifted to django 1.10 and now the image upload is not working. Code snippet is: class Images(models.Model): image =…
sprksh
  • 2,204
  • 2
  • 26
  • 43
3
votes
1 answer

Django Imagekit Background Fill

I'm just getting started with using Django and looking for a solution to crop logos and automatically detect the logo background to fill it. Most logos are rectangular but I actually need to have square images. Here is an example of what I'd like…
Alex Phelps
  • 393
  • 4
  • 8
3
votes
1 answer

ImageSpecField simply does nothing with django-imagekit in django-rest-framework

I've got the following setup: #models.py class Image(models.Model): original = models.ImageField(upload_to='images/') formatted_image = ImageSpecField(source='original', format='JPEG', options={'quality': 90}) #serializers.py class…
matteok
  • 2,189
  • 3
  • 30
  • 54
3
votes
2 answers

django imagekit processor: use dimensions stored in database

I have a model where the thumbnail width varies between parent objects (ForeignKey). I need to be able to feed this info to imagekit processors. This is what I have: class Wall(models.Model): #... width = models.SmallIntegerField(null=True,…
demux
  • 4,544
  • 2
  • 32
  • 56
3
votes
0 answers

django imagekit storing thumbnail and original file

In my model, users can upload images. For those images I want to store thumbnails too. For the task I'm trying to use django-imagekit but I don't seem to make it work class Imagen(models.Model): def get_image_path(instance, filename): …
nachoab
  • 1,908
  • 1
  • 23
  • 36
3
votes
1 answer

Memory usage in django-imagekit is unacceptable -- ideas on fixes?

Django-imagekit, which I'm using to process user uploaded images on a social media website, uses an unacceptably high level of memory. I'm looking for ideas on how to get around this problem. We are using django-imagekit to copy user uploaded…
Clay Wardell
  • 14,846
  • 13
  • 44
  • 65
3
votes
1 answer

Memory leak in Ajax implementation of a file uploader (Django on Heroku)

I've created an ajax file uploader for Django, but each file uploaded takes up a big piece of memory (30-80 mb), and doesn't seem to let it go. We're on Heroku, which allots 512mb of memory per dyno, so I quickly start getting over-memory…
Clay Wardell
  • 14,846
  • 13
  • 44
  • 65
3
votes
1 answer

Imagekit - cache image not deleted after deleting original

In my project I have a model where I use Imagekit to process an image. When I save an image I have following requirements: rename image and thumbnail to a unique name when a new image is loaded, the old one should be removed (and the thumbnail in…
Köver
  • 371
  • 4
  • 12
2
votes
1 answer

Django on heroku with imagekit saving to AWS S3 is very slow

My django app is on heroku (running with gunicorn) with a simple shared DB and the images being saved to s3. The problem being once the page has more than a few images it becomes very slow to respond (30-60 seconds). Any tips on best practice in…
Rob B
  • 1,514
  • 3
  • 23
  • 38
2
votes
0 answers

django-imagekit - do not crash when source file does not exist

I have a Django model that has an image and an autogenerated thumbnail: img = ImageField(upload_to=..., max_length=64) img_thumbnail = ImageSpecField([ResizeToFit(width=64, height=64)], source='img') For a number of reasons, the img field may…
Martin Massera
  • 1,718
  • 1
  • 21
  • 47
2
votes
0 answers

Losing metadata when uploading an image in Django Admin

I want to add a copyright notice into exif data of my displayed images. I'm using django-imagekit and piexif libraries. I can't manage to preserve nor enrich metadata of an image when I upload then process them in my Django admin. Here is my model…
2
votes
1 answer

Django admin uploaded image in production

The images i upload through the admin-interface i production cannot be found, though it exists on the server.It loads fine in development. I use Django Image-kit to resize the uploaded image. The image isn't displayed on the website and if i follow…
Morten
  • 159
  • 1
  • 12
2
votes
0 answers

Django - Images won´t be displayed in template, but image url showes up. Urls.py Issue?

Using Django 2.1.5 + Bootstrap 4.2 and some Icons from fontawesome Hello , after a long search I decided to post, because most answer are related to older Django versions. I am relatively new to Django and I like to test all the Function/Class Views…
2
votes
0 answers

Memory issue with django-imagekit

I am working on a news aggregator and use django-imagekit to create news article thumbnails. The application is hosted on Heroku. Over time, I noticed the application consumes more and more memory. Currently, there are about 8000 images in the…
apiljic
  • 527
  • 4
  • 14
2
votes
2 answers

Django SSL error

I seem to get this error, and don't know how to debug it. Any pointers? Traceback (most recent call last): File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py", line 92, in get_response response = callback(request,…
ApPeL
  • 4,801
  • 9
  • 47
  • 84
1
2
3
9 10