laravel-elixir-image-resize
This is a simple image-resize wrapper around Laravel Elixir 3. Add it to your Elixir-enhanced Gulpfile, like so:
Install
Install with npm
npm install --save-dev laravel-elixir-image-resize
For Elixir 2.* compatibility, install version 0.3.1
npm install --save-dev laravel-elixir-image-resize@0.3.1
Requires GraphicsMagick or ImageMagick
Make sure GraphicsMagick or ImageMagick is installed on your system and properly set up in your PATH
.
See gulp-image-resize installation instructions for your favorite operating system
Usage
Example Resize Gulpfile:
var elixir = ; ; ;
This will resize all image files in resources/assets/images
to the specified width
and height
and write the output to the default public/images
folder. All arguments supported by gulp-image-resize apply.
Example with Resize and Rename:
mix;
This will resize all image files in resources/assets/images
and add the suffix -lg
to the resized filename. All arguments supported by gulp-rename apply.
Examples with different source folder:
//resize, reformat & add suffix using a specific filemix; //resize, reformat & add suffix using files from alternate foldermix; //resize, reformat, but no rename using files from alternate foldermix;
Examples with different output folder:
mix;
Change Default Image Directory
Change the default image directory in elixir config. Do that in your Gulpfile like so:
elixirconfigimagePath = 'own-image-folder';
or in elixir.json:
"imagePath": "your-img-folder"