image-size.js 750 B

1234567891011121314151617181920212223242526272829
  1. module.exports = function() {
  2. var functionRegistry = require('./../less/functions/function-registry');
  3. function imageSize() {
  4. throw {
  5. type: 'Runtime',
  6. message: 'Image size functions are not supported in browser version of less'
  7. };
  8. }
  9. var imageFunctions = {
  10. 'image-size': function(filePathNode) {
  11. imageSize(this, filePathNode);
  12. return -1;
  13. },
  14. 'image-width': function(filePathNode) {
  15. imageSize(this, filePathNode);
  16. return -1;
  17. },
  18. 'image-height': function(filePathNode) {
  19. imageSize(this, filePathNode);
  20. return -1;
  21. }
  22. };
  23. functionRegistry.addMultiple(imageFunctions);
  24. };