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

how can pass height and width to the imagekit templatetag?

views.py class imagess(ImageSpec): processors = [SmartResize(100,100)] format = 'JPEG' options = {'quality': 100} register.generator('main:imagess', imagess) index.html {% generateimage 'main:imagess' source=source_file %} this…
0
votes
1 answer

Imagekit as a foreignkey - adding an image in admin

This relates to adding information in a Foreignkey field in the main admin screen. I have a Staff model. I need mugshots in 3 formats. I'd like to use django-imagekit for processing. I've made a Photo model to store the mugshot, and added it as a…
Richard
  • 1,257
  • 1
  • 10
  • 15
0
votes
1 answer

Django soft resize uploaded Image to multiple sizes and upload to respective folder

I have the following model on my App def image_path(self, filename): return 'app_name/images/{}/{}'.format(slugify(self.name), filename) class Color(models.Model): name = CICharField(max_length=22, unique=True) image =…
0
votes
1 answer

Resizing the photo by protecting the aspect ratio on Django

How can I resize image when I upload with ImageField by protecting aspect ratio of image. Example: (Width x Height) from 1100x600 to 550x300 And, is it possible with [ImageKit] ? https://github.com/matthewwithanm/django-imagekit
Efraim
  • 43
  • 6
0
votes
1 answer

How to store thumbnails in the same folder with Django ImageKit?

Does anyone have experience using ImageKit to manage thumbnails? I currently have the following in my models.py: class Item(models.Model): id = models.AutoField(primary_key=True) owner = models.ForeignKey( get_user_model(), …
0
votes
1 answer

How to programmatically create django-imagekit based content instances?

I am attempting to create default thumbnails for a learning app by using django-imagekit. I'm using Python 3.7.4 and django 3.0.4. I want to create a script to pre-load content, but the ProcessedImageField in my instance is empty after I pass it a…
robline
  • 450
  • 4
  • 13
0
votes
1 answer

django-imagekit tutorial fail - not creating thumbnails

I've tried according to this tutorial but failed. I've got everything copied exactly as it is in tutorial. The problem is that ImageKit is not creating thumbnails (both display and thumbnail images). Here is some detail: >>> from myapp.models import…
seler
  • 8,803
  • 4
  • 41
  • 54
0
votes
1 answer

How to solve image resize issue in Django?

I have multiple images upload in my Database, and when I am uploading image in Django then it's reducing the size of image (eg: 200km to 90 kb), but suppose if image size is 1000*800 then it's saving in the same size. I want to resize it with…
0
votes
0 answers

How to define django-imagekit ImageSpecFields in parent/mixin class?

I'm using django-imagekit to provide thumbnail versions of uploaded images on my Django models. I would like to define various thumbnail ImageSpecFields in a mixin that my models can then inherit. However, each model currently has a different name…
Phil Gyford
  • 13,432
  • 14
  • 81
  • 143
0
votes
0 answers

django-imagekit throwing AttributeError exception in ImageCacheFile default ctor function

I am working on a project, using the following components: django: v2.2.10 django-podcasting: 1.3.2 django-imagekit: 4.0.2 django-photologue: 3.11 When I try to add a new podcast show, I get the following error message: AttributeError at…
0
votes
1 answer

Django imagekit 'SafeString' object has no attribute 'name'

I'm currently trying to process an image using django-imagekit in my project. I'm quite new to the package, so I'm trying to implement a simple processor that converts the image to grayscale. I followed some samples from the docs. I decided to use…
Imperator123
  • 599
  • 2
  • 11
  • 25
0
votes
1 answer

Django Image field doesn't update image

I recently got a problem that my django image field in my django app doesn't update the image after pressing "Post". In admin panel everything works fine. Maybe I missed something... Let me know. models.py from django.db import models from…
0
votes
1 answer

django - any image upload and display method using Ajax?

On my django application I'm using ImageKit to resize a image loaded to the server. models.py class Pictures(ImageModel): user = models.ForeignKey(User) original_image = models.ImageField(upload_to='userpx') class IKOptions: #…
avatar
  • 12,087
  • 17
  • 66
  • 82
0
votes
1 answer

Upload an image via Admin control

I am trying to make an app where I can upload images through the Admin side, localhost:8000/admin/example but when I upload an image it gives me a 404 error when I go to the image URL. I am new to Django and python so I am trying to learn about both…
0
votes
1 answer

Django-imagekit AdminThumbnail: how to display a thumbnail but link to original uploaded file

I'm using django-imagekit in the admin, and I cannot get the listing to display a cached thumbnail but link it to the original file. How do I use original image in link, and a thumbnail in the img src? Thumbnails are created properly, they are…