0

I have a django model that I can use to dynamically load/generate images from non standard formats into numpy arrays which I convert to a PIL image and I can display.

class Thing(models.Model):
    def gethttpimage(self):
            img = ....
            # get find file and load into numpy array as img
            image = Image.fromarray(img.astype(np.uint8))
            response = HttpResponse(content_type="image/png")
            image.save(response, "PNG")
            return response

I also have a view that passes this response to a URL which works great.

I want to use a package such as django-imagekit or django-photologue to display my generated images as thumbnails galleries, etc and use the various other features imagekit offers.

How can I accomplish this with django-imagekit or django-photologue?

EDIT: I don't have my heart set on imagekit. I want to be able to build views with image galleries, as well as other information

jmerkow
  • 1,811
  • 3
  • 20
  • 35
  • I assume you mean without saving the images to the hard disk? Otherwise the answer is simply - save your image to the filesystem, and then use django-imagekit as normal. – Burhan Khalid Apr 17 '16 at 03:25
  • I could save cached images, but there are millions of potential images so saving them all wouldn't work. Only ~100-200 would be viewed at a time. – jmerkow Apr 17 '16 at 03:36

0 Answers0