Sunday, October 3, 2010

An app to create sprite bundles (django-imaginator)

Hello everyone,

I had this idea for an django application that creates image sprites automatically for you. I want an application that allows me to create and manage sprites by only using the admin interface. This is how it should work:

- Add 'django-imaginator' to your INSTALLED_APPS
- Run syncdb, the app creates two new models - Sprites and Images
- Open the Admin interface and add a new Sprite, it has a mandatory slug field in it.
- Create new Images, they have a ImageField, an slug and a ForeignKey pointing to which Sprite they belong.

Now you run a custom manage.py command that uses PIL to compile all images into sprites. It also generate any required CSS.

Now, in your templates you will display the images by using a custom template tag, something like this

{% sprite 'sprite_slug' 'image_slug' %}

which will be rendered as an HTML <img> tag.

That's basically how it should work, but I wanted your opinion before I start to write any code. Do you think that this app is a good idea or it's doomed to failure? Are there other apps that already do this? I also a bit worried on version control, since the image will be stored in the database I don't I will be able to keep a version control of the sprites and rollback changes if required.

Any opinions?

Thanks,
Cesar Canassa




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment