@@ -111,11 +111,6 @@ const OVERSIZED_IMAGE_TOLERANCE = 1000;
111111const FIXED_SRCSET_WIDTH_LIMIT = 1920 ;
112112const FIXED_SRCSET_HEIGHT_LIMIT = 1080 ;
113113
114- /**
115- * Default blur radius of the CSS filter used on placeholder images, in pixels
116- */
117- export const PLACEHOLDER_BLUR_AMOUNT = 15 ;
118-
119114/**
120115 * Placeholder dimension (height or width) limit in pixels. Angular produces a warning
121116 * when this limit is crossed.
@@ -279,7 +274,8 @@ export interface ImagePlaceholderConfig {
279274 '[style.background-position]' : 'placeholder ? "50% 50%" : null' ,
280275 '[style.background-repeat]' : 'placeholder ? "no-repeat" : null' ,
281276 '[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' ,
283279 } ,
284280} )
285281export class NgOptimizedImage implements OnInit , OnChanges {
@@ -687,7 +683,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
687683 * * A base64 encoded image, which is wrapped and passed through.
688684 * * A boolean. If true, calls the image loader to generate a small placeholder url.
689685 */
690- private generatePlaceholder ( placeholderInput : string | boolean ) : string | boolean | null {
686+ protected generatePlaceholder ( placeholderInput : string | boolean ) : string | boolean | null {
691687 const { placeholderResolution} = this . config ;
692688 if ( placeholderInput === true ) {
693689 return `url(${ this . callImageLoader ( {
@@ -705,7 +701,7 @@ export class NgOptimizedImage implements OnInit, OnChanges {
705701 * Determines if blur should be applied, based on an optional boolean
706702 * property `blur` within the optional configuration object `placeholderConfig`.
707703 */
708- private shouldBlurPlaceholder ( placeholderConfig ?: ImagePlaceholderConfig ) : boolean {
704+ protected shouldBlurPlaceholder ( placeholderConfig ?: ImagePlaceholderConfig ) : boolean {
709705 if ( ! placeholderConfig || ! placeholderConfig . hasOwnProperty ( 'blur' ) ) {
710706 return true ;
711707 }
0 commit comments