Hello, >From my experience with sprites, you wouldn't be using an image tag to render the sprite. Rather, you would be giving an id or class attribute on a div or some other type of HTML container tag that positions the background image (sprite) and possibly sets a width and height on the container to prevent overflow.
>From an organizational standpoint, knowing which images are in a sprite would be nice, but from my perspective, this might get to be a maintenance nightmare. Sometimes you need extra space between sprites or you might want to do selective optimization on the image, etc. Plus, you might end up with inline-css to position the background image within each element, which would make it impossible to override from a css file. All that being said, probably not worth the effort from my experience as a presentation layer architect on big and small projects. Kindest regards, Brandon On Oct 3, 3:48 pm, Cesar Canassa <cesar.cana...@gmail.com> wrote: > 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.