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

sub folder support for image resizing #39

Open
YehudaK opened this issue Oct 7, 2017 · 0 comments
Open

sub folder support for image resizing #39

YehudaK opened this issue Oct 7, 2017 · 0 comments

Comments

@YehudaK
Copy link

YehudaK commented Oct 7, 2017

This will enable sub folder support via cwd option:

cwd: 'assets/src/',
src: '*/*.png',
dest: 'assets/images/',

the files will be resized from > to:

assets/src/folder/image.png > assets/images/folder/image.png
assets/src/another/file.jpg > assets/images/another/file.jpg
-51 filepath = f, imOptions = {
+51 filepath = (list.cwd || '')+f, imOptions = {
-53 dstPath:  (list.dest[list.dest.length-1] !== '/') ? list.dest : path.join(dirname, path.basename(filepath)) ,
-53 dstPath:  (list.dest[list.dest.length-1] !== '/') ? list.dest : path.join(dirname, path.dirname(f), path.basename(filepath)) ,
-104 grunt.log.ok('Image '+filepath+' resized to '+ list.dest);
+104 grunt.log.ok('Image '+filepath+' resized to '+ imOptions.dstPath);

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant