features request: windows support, running inside existing virtual host

Asked by Rene Anonymous on 2011-06-15


Thank you a lot for releasing the code for css sprite generator.
I'm building some animated web components that sometimes have > 1mb of source images, and the online version on your site http://spritegen.website-performance.org/ won't work for me then (0.5mb max).
My components do ordered animations, and thus require that the source images are alphabetically sorted before being put into the sprite, something online css sprite generators don't do.

So I downloaded the source, and tried following the instructions.
But it's not easy, maybe impossible, to install a new virtual host in the wamp package i'm using (http://www.wampserver.com/en/).

So i was wondering if you'd be willing to change the source to allow css sprite gen to run inside an existing virtual host. I have imagemagick in my windows %PATH% already. I hope optipng is available for windows too..

I may try to make these changes myself and donate them back to you, or I may try booting into linux and running css sprite generator from there. However, the rest of my web sources are on a crypted volume that I can't mount in the linux i'm using, so i have some motivation to make these changes to the css sprite gen sources.

I'd like to know if you would accept the changes needed to get css sprite gen to work on windows & wampserver..

And i'd like to know if i'm allowed to run a copy (modified or not) of css sprite gen on a public site.
I want to make one available that doesn't have a upload size limitation.


Question information

English Edit question
CSS Sprite Generator Edit question
No assignee Edit question
Solved by:
Rene Anonymous
Last query:
Last reply:
Revision history for this message
Rene Anonymous (rene-veerman-netherlands) said :

Well, i spent just over half a day trying to get your sources to play with my windows env, but in the end i gave up and rolled my own modest sprite generator to suit my needs, which was done in about 1.5 hrs.

Good luck with your source set. No hard feelings whatsoever.

Revision history for this message
Rene Anonymous (rene-veerman-netherlands) said :

For those interested to know how i rolled my own sprite generator for windows in 1.5hrs;

I used the commandline version of imagemagick.

With php's exec(), i first create an empty picture;

convert -size 1000x2040 xc:none "d:\path\to\output.png"

Then i loop through the source images, doing for each:

composite -geometry +x+y "d:\path\to\source_frame_n.png" "d:\path\to\output.png" "d:\path\to\output.png"

where +x+y is the position of the source frame in the output image.
note that the double listing of output.png in the composite call is by design. the first one is "image to overlay the frame.png on", the second one is where to write the output to.

it's slow, inefficient as hell, but it gets the job done.
set_time_limit(0) at the top of your script.

if you install imagemagick commandline, either put it in your windows %PATH% or put the complete path to the binaries in your exec() calls.

Revision history for this message
Rene Anonymous (rene-veerman-netherlands) said :

I may make my this sprite generator i wrote available (without size limitations) to the public within a few months. I'll post the URL on this page if and when i do.