{"comment":{"created_at":"2011-10-09T13:25:01Z","body":"oh this is a configuration issue not a compass issue you need to set your image_dir relative to your project config file so in this case it would be the same as image_path","updated_at":"2011-10-09T13:25:01Z","url":"https://api.github.com/repos/chriseppstein/compass/issues/comments/2336536","id":2336536,"user":{"avatar_url":"https://secure.gravatar.com/avatar/360d0f0a5d0267a1f6b41b57f6a63cc3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/scottdavis","id":11871,"login":"scottdavis"}},"action":"created","issue":{"number":583,"created_at":"2011-10-05T16:51:06Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Project layout:\r\n\r\n    /scss\r\n    /public\r\n        /css\r\n        /images\r\n            bg.png\r\n\r\nCompass project resides in ```/scss```, images are in ```public/images```, compiled CSS is expected to be in ```public/css```.\r\n\r\nContents of config.rb:\r\n\r\n```ruby\r\nproject_type = :stand_alone\r\nhttp_path = \"/\"\r\nsass_dir = \".\"\r\ncss_path = \"../public/css\"\r\ncss_dir = \"css\"\r\nimages_path = \"../public/images\"\r\nimages_dir = \"images\"\r\n```\r\n    \r\nContents of test.scss:\r\n\r\n    .test {\r\n        background-image: image-url('bg.png');\r\n    }\r\n\r\nCompilation process (Compass v0.11.5):\r\n\r\n    D:\\project>cd test\r\n    \r\n    D:\\project\\test>compass compile\r\n    WARNING: 'bg.png' was not found (or cannot be read) in D:/project/test/images\r\n       create test.css\r\n    \r\n    D:\\project\\test>\r\n\r\nPlease notice \"File not found\" warning and invalid path, image is searched in.\r\n\r\nResulted CSS:\r\n\r\n    .test {\r\n      background-image: url('/images/bg.png');\r\n    }\r\n\r\nSmall research shows that problem is in ```lib/compass/sass_extensions/functions/urls.rb``` lines 73-76:\r\n\r\n```ruby\r\n# Compute the real path to the image on the file stystem if the images_dir is set.\r\nreal_path = if Compass.configuration.images_dir\r\n  File.join(Compass.configuration.project_path, Compass.configuration.images_dir, path)\r\nend\r\n```\r\n\r\n As can be seen - real path calculation uses ```project_path``` configuration variable as base path, but Compass documentation ( http://compass-style.org/help/tutorials/configuration-reference/#configuration-properties ) says that ```project_path``` is ignored when ```project_type = :stand_alone```. Hence this expression leads to invalid path which results in above warning.\r\n\r\nQuick fix which works fine for me is to check if ```images_path``` configuration variable is defined and use it for path calculation if it is:\r\n\r\n```ruby\r\n# Compute the real path to the image on the file system if the images_dir is set.\r\nreal_path = if Compass.configuration.images_path\r\n  File.join(Compass.configuration.project_path, Compass.configuration.images_path, path)\r\nelsif Compass.configuration.images_dir\r\n  File.join(Compass.configuration.project_path, Compass.configuration.images_dir, path)\r\nend\r\n```\r\n\r\nHowever I may be wrong in my proposed fix since I don't know project codebase well.","comments":4,"title":"Problem with paths calculation for cache buster in image-url()","updated_at":"2011-10-09T13:25:01Z","url":"https://api.github.com/repos/chriseppstein/compass/issues/583","id":1825674,"assignee":{"avatar_url":"https://secure.gravatar.com/avatar/360d0f0a5d0267a1f6b41b57f6a63cc3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/scottdavis","id":11871,"login":"scottdavis"},"milestone":{"number":15,"created_at":"2011-10-05T06:18:09Z","due_on":null,"title":"0.12","creator":{"avatar_url":"https://secure.gravatar.com/avatar/360d0f0a5d0267a1f6b41b57f6a63cc3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/scottdavis","id":11871,"login":"scottdavis"},"url":"https://api.github.com/repos/chriseppstein/compass/milestones/15","open_issues":13,"closed_issues":0,"description":"","state":"open"},"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/27e8ae8401f23c5322bc568f1674da83?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/FlyingDR","id":822673,"login":"FlyingDR"},"html_url":"https://github.com/chriseppstein/compass/issues/583","labels":[],"state":"open"},"legacy":{"issue_id":1825674,"comment_id":2336536}}