@@ -111,11 +111,6 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
111
111
const FIXED_SRCSET_WIDTH_LIMIT = 1920 ;
112
112
const FIXED_SRCSET_HEIGHT_LIMIT = 1080 ;
113
113
114
- /**
115
- * Default blur radius of the CSS filter used on placeholder images, in pixels
116
- */
117
- export const PLACEHOLDER_BLUR_AMOUNT = 15 ;
118
-
119
114
/**
120
115
* Placeholder dimension (height or width) limit in pixels. Angular produces a warning
121
116
* when this limit is crossed.
@@ -279,7 +274,8 @@ export interface ImagePlaceholderConfig {
279
274
'[style.background-position]' : 'placeholder ? "50% 50%" : null' ,
280
275
'[style.background-repeat]' : 'placeholder ? "no-repeat" : null' ,
281
276
'[style.background-image]' : 'placeholder ? generatePlaceholder(placeholder) : null' ,
282
- '[style.filter]' : `placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(${ PLACEHOLDER_BLUR_AMOUNT } px)" : null` ,
277
+ '[style.filter]' :
278
+ 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null' ,
283
279
} ,
284
280
} )
285
281
export class NgOptimizedImage implements OnInit , OnChanges {
@@ -687,7 +683,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
687
683
* * A base64 encoded image, which is wrapped and passed through.
688
684
* * A boolean. If true, calls the image loader to generate a small placeholder url.
689
685
*/
690
- private generatePlaceholder ( placeholderInput : string | boolean ) : string | boolean | null {
686
+ protected generatePlaceholder ( placeholderInput : string | boolean ) : string | boolean | null {
691
687
const { placeholderResolution} = this . config ;
692
688
if ( placeholderInput === true ) {
693
689
return `url(${ this . callImageLoader ( {
@@ -705,7 +701,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
705
701
* Determines if blur should be applied, based on an optional boolean
706
702
* property `blur` within the optional configuration object `placeholderConfig`.
707
703
*/
708
- private shouldBlurPlaceholder ( placeholderConfig ?: ImagePlaceholderConfig ) : boolean {
704
+ protected shouldBlurPlaceholder ( placeholderConfig ?: ImagePlaceholderConfig ) : boolean {
709
705
if ( ! placeholderConfig || ! placeholderConfig . hasOwnProperty ( 'blur' ) ) {
710
706
return true ;
711
707
}
0 commit comments