Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the {% image %} tag support other images known to django, not just wagtailimages #755

Closed
davecranwell opened this issue Oct 27, 2014 · 6 comments

Comments

@davecranwell
Copy link
Contributor

For example on a current project, users upload a photo to represent an event, but events are submitted by the public and not everyone will have a suitable photo, so a placeholder is displayed alongside their event instead.

That placeholder image is something the developer has had to create, but as event photos get displayed in numerous places, we need to create numerous versions of that placeholder to suit the placement, which is tedious.

It would be great if the {% image %} tag could be given a path to a static image, and automatically generate the images at the dimensions we specify.

@kaedroho
Copy link
Contributor

This one would need some database changes as the Rendition model is currently linked with the Image model. A possible solution might be to instead, link renditions to image source files. This has the added benefit that you can create a rendition from anything without needing to create an Image first. It would also make creating custom image models simpler as well.

@davecranwell
Copy link
Contributor Author

A cheaper option might be to have a separate image tag for static images, hooking into the same resizing features, but if an update to the current image tag would be workable, that would be best for me.

@kaedroho
Copy link
Contributor

I think that it would be good to cache the resulting image which is something that hooking into Rendition gives us.

@davecranwell davecranwell modified the milestone: Backlog Oct 30, 2014
@davecranwell davecranwell modified the milestones: 0.9, Backlog Dec 18, 2014
@davecranwell
Copy link
Contributor Author

I've discovered a new need for this today. I'll be developing a more extensive user profile in due course, to store more user preferences associated with how they use the wagtail admin. One of these new fields is a proper avatar. At the moment we use Gravatar, which is confusing for pretty much everyone since a Wordpress account became a requirement.

I'll be falling back on Gravatar, but adding a "Welcome" screen to wagtail in which users are urged to upload an avatar to a regular django FileField. That avatar will need to be resized into various formats as the situation dictates. Given the amount of work that's gone into the image resizing system it would be churlish to create these avatar size formats any other way.

This is perhaps a slightly different request to the original issue, as previously I wanted to resize any arbitrary image found on disk. This time it's an image that django is already aware of to some degree.

@davecranwell davecranwell changed the title It would be great if the image tag could be used to format static assets too Make the {% image %} tag support other images known to django, not just wagtailimages Jan 8, 2015
@davecranwell davecranwell modified the milestones: 1.0, 0.9 Feb 24, 2015
@davecranwell
Copy link
Contributor Author

On a more practical point, users may be integrating Wagtail with existing products and may find it tedious to have to install multiple thumbnailing tags. If wagtail could thumbnail anything, it could be a replacement.

@davecranwell davecranwell reopened this Jun 25, 2015
@gasman gasman removed this from the 1.1 milestone Sep 7, 2015
@gasman gasman added this to the 1.5 milestone Jan 20, 2016
@gasman gasman modified the milestones: real-soon-now, 1.5 May 10, 2016
@killarny
Copy link

killarny commented Apr 6, 2020

Curious whether this is going anywhere, or has been forgotten about or replaced with other functionality that I'm not aware of?

I'm VERY new to wagtail, but already really wishing I could pass a static image path to the {% image %} tag so that I can resize user avatar images as needed in my templates.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

6 participants