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

Improvement of src management #51

Closed
wants to merge 1 commit into from
Closed

Improvement of src management #51

wants to merge 1 commit into from

Conversation

Prevole
Copy link

@Prevole Prevole commented Jun 17, 2014

When I tried to use the grunt-response-images task, I encounter few errors when I tried to configure the src like that:

{
  src: ['some/path/**/*']
}

This is the error I received:

Warning: Command failed: gm identify: Unable to open file (some/path/subdirectory) [No such file or directory].
gm identify: Request did not return an image.
 Use --force to continue.

That's quite normal. In fact, the task try to give a directory to the image library for resizing. Logically, it is not possible to handle a directory for resizing.

I spent few hours to understand my mistake that it is mandatory to give the src like that:

{
  src: ['some/path/**/*{jpg,gif,png}']
}

In my opinion, we should be able to not be forced to specify the file extensions. It will be more in the way that grunt handle the files.

To solve the issue, I added a check if the the current src path evaluated is a directory or not.

I understand that in some cases, when we mix images and other file types in a directory tree, to have the extensions in the src is clearly a better solution but in case where we have only images, a simple notation is preferable.

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.

None yet

2 participants