@@ -3,81 +3,101 @@ import ImageCache from '../dist/index';
33
44const imagecache = new ImageCache ( presets ) ;
55
6- imagecache . render ( './in.png' , 's_crop_tiny ' , ( err , image ) => {
6+ imagecache . render ( './in.png' , 'canvas_scale_with_blur ' , ( err , image ) => {
77 if ( err ) {
8- console . log ( 'Failed to process image out_s_crop_tiny .png.' ) ;
8+ console . log ( 'Failed to process image in .png with preset canvas_scale_with_blur .' ) ;
99 console . log ( err ) ;
1010
1111 return ;
1212 }
1313
14- image . toFile ( 'out_s_crop_tiny .png' , ( saveErr , info ) => {
14+ image . toFile ( 'out_canvas_scale_with_blur .png' , ( saveErr , info ) => {
1515 if ( saveErr ) {
16- console . log ( 'Failed to save image out_s_crop_tiny .png.' ) ;
16+ console . log ( 'Failed to save image out_canvas_scale_with_blur .png.' ) ;
1717 console . log ( err ) ;
1818
1919 return ;
2020 }
2121
22- console . log ( `Saved image out_s_crop_tiny .png with width ${ info . width } and height ${ info . height } .` ) ;
22+ console . log ( `Saved image out_canvas_scale_with_blur .png with width ${ info . width } and height ${ info . height } .` ) ;
2323 } ) ;
2424} ) ;
2525
26- imagecache . render ( './in.png' , 's_crop_small ' , ( err , image ) => {
26+ imagecache . render ( './in.png' , 'scale_crop_tiny ' , ( err , image ) => {
2727 if ( err ) {
28- console . log ( 'Failed to process image out_s_crop_small .png.' ) ;
28+ console . log ( 'Failed to process image in .png with preset scale_crop_tiny .' ) ;
2929 console . log ( err ) ;
3030
3131 return ;
3232 }
3333
34- image . toFile ( 'out_s_crop_small .png' , ( saveErr , info ) => {
34+ image . toFile ( 'out_scale_crop_tiny .png' , ( saveErr , info ) => {
3535 if ( saveErr ) {
36- console . log ( 'Failed to save image out_s_crop_small .png.' ) ;
36+ console . log ( 'Failed to save image out_scale_crop_tiny .png.' ) ;
3737 console . log ( err ) ;
3838
3939 return ;
4040 }
41- console . log ( `Saved image out_s_crop_small.png with width ${ info . width } and height ${ info . height } .` ) ;
41+
42+ console . log ( `Saved image out_scale_crop_tiny.png with width ${ info . width } and height ${ info . height } .` ) ;
43+ } ) ;
44+ } ) ;
45+
46+ imagecache . render ( './in.png' , 'scale_crop_small' , ( err , image ) => {
47+ if ( err ) {
48+ console . log ( 'Failed to process image in.png with preset scale_crop_small.' ) ;
49+ console . log ( err ) ;
50+
51+ return ;
52+ }
53+
54+ image . toFile ( 'out_scale_crop_small.png' , ( saveErr , info ) => {
55+ if ( saveErr ) {
56+ console . log ( 'Failed to save image out_scale_crop_small.png.' ) ;
57+ console . log ( err ) ;
58+
59+ return ;
60+ }
61+ console . log ( `Saved image out_scale_crop_small.png with width ${ info . width } and height ${ info . height } .` ) ;
4262 } ) ;
4363} ) ;
4464
45- imagecache . render ( './in.png' , 's_crop_teaser ' , ( err , image ) => {
65+ imagecache . render ( './in.png' , 'scale_crop_teaser ' , ( err , image ) => {
4666 if ( err ) {
47- console . log ( 'Failed to process image out_s_crop_teaser .png.' ) ;
67+ console . log ( 'Failed to process image in .png with preset scale_crop_teaser .' ) ;
4868 console . log ( err ) ;
4969
5070 return ;
5171 }
5272
53- image . toFile ( 'out_s_crop_teaser .png' , ( saveErr , info ) => {
73+ image . toFile ( 'out_scale_crop_teaser .png' , ( saveErr , info ) => {
5474 if ( saveErr ) {
55- console . log ( 'Failed to save image out_s_crop_teaser .png.' ) ;
75+ console . log ( 'Failed to save image out_scale_crop_teaser .png.' ) ;
5676 console . log ( err ) ;
5777
5878 return ;
5979 }
6080
61- console . log ( `Saved image out_s_crop_teaser .png with width ${ info . width } and height ${ info . height } .` ) ;
81+ console . log ( `Saved image out_scale_crop_teaser .png with width ${ info . width } and height ${ info . height } .` ) ;
6282 } ) ;
6383} ) ;
6484
65- imagecache . render ( './in.png' , 's_scale_teaser ' , ( err , image ) => {
85+ imagecache . render ( './in.png' , 'scale_with_watermark ' , ( err , image ) => {
6686 if ( err ) {
67- console . log ( 'Failed to process image out_s_scale_teaser .png.' ) ;
87+ console . log ( 'Failed to process image in .png with preset scale_with_watermark .' ) ;
6888 console . log ( err ) ;
6989
7090 return ;
7191 }
7292
73- image . toFile ( 'out_s_scale_teaser .png' , ( saveErr , info ) => {
93+ image . toFile ( 'out_scale_with_watermark .png' , ( saveErr , info ) => {
7494 if ( saveErr ) {
75- console . log ( 'Failed to save image out_s_scale_teaser .png.' ) ;
95+ console . log ( 'Failed to save image out_scale_with_watermark .png.' ) ;
7696 console . log ( err ) ;
7797
7898 return ;
7999 }
80100
81- console . log ( `Saved image out_s_scale_teaser .png with width ${ info . width } and height ${ info . height } .` ) ;
101+ console . log ( `Saved image out_scale_with_watermark .png with width ${ info . width } and height ${ info . height } .` ) ;
82102 } ) ;
83103} ) ;
0 commit comments