Skip to content

sub folder support for image resizing #39

@YehudaK

Description

@YehudaK

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions