Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "image_url" function and "image_path" option #522

Closed
wants to merge 8 commits into from

Conversation

nschonni
Copy link
Collaborator

@nschonni nschonni commented Oct 9, 2014

BREAKING CHANGE

This function doesn't currently exist in the Sass spec.
Fixes gh-489


The testing will fail unless SassC is also updated, or the image_path option is left in and noop'd

@HamptonMakes
Copy link
Member

People are going to hate us. But, your right. This should be a breaking change to go to 3.0, it's more worth it. URL handling is still weak, so we need to make sure this is doable in Sass or equivalent.

@HamptonMakes
Copy link
Member

Hmmm... so I merged this in locally, there were still image_url references, so the build wouldn't happen. So, I went through and removed them.

As I was running the test suite.... it ran 10-20x slower. Seriously. No idea why.

I'm re-changing my mind. I think we need to have a better plan on how to handle image paths and stuff. And, the fact that it's causing my fan to turn on for some insane mysterious reason... it's a sign!

@nschonni
Copy link
Collaborator Author

Apparently I missed something or failed to commit something in context.cpp 😊

I also needed to make the following changes in sassc to get the local changes to run

diff --git a/sassc.c b/sassc.c
index 7e97ffd..e4826e1 100644
--- a/sassc.c
+++ b/sassc.c
@@ -157,7 +157,6 @@ int main(int argc, char** argv) {
     bool generate_source_map = false;
     struct sass_options options = { 0 };
     options.output_style = SASS_STYLE_NESTED;
-    options.image_path = "images";
     char *include_paths = NULL;
     options.precision = 5;

diff --git a/sassloop.c b/sassloop.c
index 992b594..d05d262 100644
--- a/sassloop.c
+++ b/sassloop.c
@@ -4,7 +4,7 @@
 #include "libsass/sass_interface.h"

 int main(int argc, char** argv)
-{  
+{
    if (argc < 3) {
        printf("Usage: sassloop [INPUT FILE] [ITERATIONS]\n");
        return 0;
@@ -15,7 +15,6 @@ int main(int argc, char** argv)
        struct sass_file_context* ctx = sass_new_file_context();
        printf("*** ALLOCATED A NEW CONTEXT\n");
        ctx->options.include_paths = "";
-       ctx->options.image_path = "images";
        ctx->options.output_style = SASS_STYLE_NESTED;
        ctx->input_path = argv[1];
        printf("*** POPULATED THE CONTEXT\n");
@@ -31,10 +30,10 @@ int main(int argc, char** argv)
      else {
        printf("Unknown internal error.\n");
      }
-       
+
      sass_free_file_context(ctx);
      printf("*** DEALLOCATED THE CONTEXT\n");
      sleep(1);
    }
    return 0;
-}
\ No newline at end of file
+}

@am11
Copy link
Contributor

am11 commented Mar 3, 2015

This was addressed by #834.

@xzyfer xzyfer closed this Mar 3, 2015
@nschonni nschonni deleted the remove-image-url branch March 8, 2015 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should libsass have an image-url function?
6 participants