Can you dynamically request a (cached &) scaled image via imagecache in css? Is there a way to request a scaled image via imagecache by adding width/height parameters or a preset-reference to the image url within css? For example:

Obviously, to scale down an image in css, you can do the following:

HTML:  

&lt;figure id="logo"&gt;&lt;/figure&gt;


CSS:

#logo {  
  background: url('path/to/image.jpg') no-repeat;  
  width: 50%;  
  height: 50%  
}


This will still load the full sized image and scale it down on the client side. I am wondering if something like the following is possible within CSS, so you dynamically request a scaled image via imagecache:

#logo {  
  background: url('path/to/image.jpg?width=50px&amp;height=50px') no-repeat;  
}


or

#logo { 
  background: url('path/to/image.jpg?preset=existingimgpreset') no-repeat;  
}


Which will scale down the image on the server side and hopefully will return a cached version of it when possible.
The URLs imagecache produces are pretty reliable, and contain the name of the preset. Looking at the code in imagecache_create_url() you could build up a path in your CSS that looks something like this:

/sites/default/files/imagecache/preset-name/path/to/image.jpg


Assuming that your files are stored at /sites/default/files