Smilie sprite support

  • Rather than have the site download many smilies, it would be nice if it could download 1 single image. I would love to see sprite support.

  • Problem with that is adding new smilies to the sprite. You'd have to update the sprite every time the admins adds a smiliey, only to run him into memory limits rather quickly.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy

  • Problem with that is adding new smilies to the sprite. You'd have to update the sprite every time the admins adds a smiliey, only to run him into memory limits rather quickly.


    I understood the first part of that, but completely fail to understand what you mean by memory limits. I have been using a system with smilie sprites and have never had any memory issues.


    Can you please explain?

  • Rewriting an image comsumes vast amounts of memoy with PHP. That's why the gallery doesn't produce thumbnails for big images. You can't open them with PHP without loading them fully into memory.


    And you#d have to open all the smileys, and aggregate them into the sprite. This would be a very expensive operation. Granted, it doesn't occur that often, but some ppl. drop several hundreds of smileys into their boards.


    Furthermore im not convinced that using a sprite will really do much good. For the most part, only few of the smileys were used. As it is now, you#d only have to download those few smilieys that are actually embedded in posts while reading a topic. If you batch them all together into a sprite, you#d have to download the whole sprite every time there is only one smiley in a post. This would in turn possibly lead to strange artifactes when the sprite isn#t fully loaded, and make smileys pop out of nowehere once it finishes loading. Much like you already have with big background images when viewing sites with a slow connection.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy

  • I disagree.


    Each individual smilie on most sites average about 4kb each.
    Assume you only have 10 smilies
    That is a collective total of 40kb


    On the spite, all 10 images can load on 1 photo, and the sprite can be optimized for 4kb total.


    So if memory if your concern, you're saving more using a sprite.

  • Rewriting an image comsumes vast amounts of memoy with PHP. That's why the gallery doesn't produce thumbnails for big images. You can't open them with PHP without loading them fully into memory.


    And you#d have to open all the smileys, and aggregate them into the sprite. This would be a very expensive operation. Granted, it doesn't occur that often, but some ppl. drop several hundreds of smileys into their boards.


    Such a feature doesn't require rewriting the image. You'd make the spritesheet in Photoshop or whichever program you use and then you could set the coordinates for each smiley in the ACP. WBB doesn't need to be involved in editing/updating the spritesheet itself.

  • Such a feature doesn't require rewriting the image. You'd make the spritesheet in Photoshop or whichever program you use and then you could set the coordinates for each smiley in the ACP. WBB doesn't need to be involved in editing/updating the spritesheet itself.


    This is way to complicated and will probably never be implemented. If you need to manually create the image and the mapping it's too complicated. You need to be able to simply upload the smiley and be done with it. Thus, the image needs to be created by WCF.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy


  • This is way to complicated and will probably never be implemented. If you need to manually create the image and the mapping it's too complicated. You need to be able to simply upload the smiley and be done with it. Thus, the image needs to be created by WCF.


    Assuming that the smilies on the sheet are all the same size, then determining the coordinates would be as simple as putting in the size. WBB could then make a smiley with each of the coordinates and all you'd have to do would be naming each of them and setting the text to replace with them.


    I believe that's how XF does it.

  • You'd have to maintain backwards compatibility, which means you'd have to support adding smileys via package/plugin. So the whole discussion about manually creating spritesheets is moot, because that would essentially break the whole Smiley-PIP. Furthermore it simply wouldn#t fit WBBs philosophy. WoltLab takes great pride in the fact that you do *not* need to edit files yourself.


    So we are again at generating the spritesheet on the server side. Not saying I'm against it, but my original point still stands, this is an expensive operation - especially when someone decides to upload smileys in various sizes. Then you'd need to either scale them, which might make them look bad, or support spritesheets with multi-size sprites.


    On a side note, if number of requests is your concern, take a look at SPDY. Modern browsers already support it.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy

  • You'd have to maintain backwards compatibility, which means you'd have to support adding smileys via package/plugin. So the whole discussion about manually creating spritesheets is moot, because that would essentially break the whole Smiley-PIP. Furthermore it simply wouldn#t fit WBBs philosophy. WoltLab takes great pride in the fact that you do *not* need to edit files yourself.


    So we are again at generating the spritesheet on the server side. Not saying I'm against it, but my original point still stands, this is an expensive operation - especially when someone decides to upload smileys in various sizes. Then you'd need to either scale them, which might make them look bad, or support spritesheets with multi-size sprites.


    Not sure how backwards compatibility comes into play here, the suggestion here isn't to do away with the ability to use normal images as smilies, it's to add the option of having smilies that use a spritesheet.


    Here's what adding smilies looks like in XF.



    You have the option of using CSS sprite mode for smilies or you can just use individual images for smilies.

  • @Netzerg I do not understand your logic.


    You could still upload individual smilies
    You can have spite support as well


    Nothing would need to be rewritten on the server
    No extra memory would be required.


    Backward compatibility would still function.

  • Not sure how backwards compatibility comes into play here, the suggestion here isn't to do away with the ability to use normal images as smilies, it's to add the option of having smilies that use a spritesheet.


    Sorry, I thought you'd wanted to use spritesheets exclusively.


    In that case it makes more sense, bot then you'd only get half the benefits either, because only those smileys which were batched manually can be loaded as sprite. Which will probably be very little. So you probably only gain something for the smileys that were delivered with the software itself. And when you start installing smiley packs, you'd again have multiple files.

    "A life is like a garden. Perfect moments can be had, but not preserved, except in memory. LLAP" — Leonard Nimoy


  • Sorry, I thought you'd wanted to use spritesheets exclusively.


    In that case it makes more sense, bot then you'd only get half the benefits either, because only those smileys which were batched manually can be loaded as sprite. Which will probably be very little. So you probably only gain something for the smileys that were delivered with the software itself. And when you start installing smiley packs, you'd again have multiple files.


    I have smilie pack that has over 50+ smilies. It's 1 single sprite.


    So I think this can be beneficial

  • Sorry, I thought you'd wanted to use spritesheets exclusively.


    Using them exclusively wouldn't really work anyways. A lot of people use animated .GIF smilies, and those would never work as a sprite.


    When it comes to those non-animated smiley sets though, it's really not hard to put them into a sprite sheet and the benefit of doing so is that only one image will need to be loaded for those smilies rather than a bunch of images.