Closed GoogleCodeExporter closed 9 years ago
Original comment by stevesou...@gmail.com
on 1 Sep 2009 at 6:06
Original comment by stevesou...@gmail.com
on 1 Sep 2009 at 11:02
I added size.cgi which returns the Content-Length of images in a script. It's
slow -
you have to run it on all the images. I'll add a new issue to handle batch mode.
Original comment by stevesou...@gmail.com
on 4 Sep 2009 at 4:40
size.cgi works, but I'm not happy about the load it puts on spriteme.org, and
also
not happy about the traffic it generates requesting every image in the page. It
would
be better to go back to the original idea and embed this functionality in
coolRunnings to return the total size of all the individual images as well as
the
size of the resultant sprite.
Original comment by stevesou...@gmail.com
on 6 Sep 2009 at 1:29
OK. CooLrunnings is already downloading all the images, so it shouldn't be hard
to
get their sizes.
Original comment by jaredhir...@yahoo.com
on 9 Sep 2009 at 12:25
notes to myself: When coolRunnings supports this, modify these parts of
spriteme.js:
updateHtml: function() {
// TODO - This is temporary until we get height&width and size in the
coolRunnigs response.
if ( !this.bgImages[0].width || !this.bgImages[0].size ) {
var spriteObj = this;
setTimeout(function() { spriteObj.updateHtml(); }, 500);
if ( -1 === iLink ) {
//SpriteMe_autospriteCallback();
// TODO - Right now, there's a race condition with size.cgi. That'll go away when
// coolRunnings returns the file size. For now, do a setTimeout.
setTimeout(SpriteMe_autospriteCallback, 3000);
Original comment by stevesou...@gmail.com
on 9 Sep 2009 at 11:50
It would be cool to return three things:
1 - total size of all the input images
2 - size of the resulting sprite image
3 - dimensions of the sprite image (width & height)
I'm fine if you want to return saved bytes, but I can get that from the delta
of 1 & 2.
Original comment by stevesou...@gmail.com
on 11 Sep 2009 at 5:19
Here's the new json output. I can make changes to the formatting; just ask.
var coolRunnings =
{"url":"http:\/\/www.jaredhirsch.com\/coolrunnings\/public_images\/75c0e3f5e2\/g
hosts-a-plenty.png","inputSize":1209,"outputSize":794,"spriteHeight":75,"spriteW
idth":222}
Original comment by jaredhir...@yahoo.com
on 11 Sep 2009 at 11:13
Original issue reported on code.google.com by
stevesou...@gmail.com
on 1 Sep 2009 at 6:05