BP_Attachment_Avatar::is_too_small( string $file = '' )

Check if the image dimensions are smaller than full avatar dimensions.

Description

Parameters

$file

(Optional) the absolute path to the file.

Default value: ''

Return

(bool)

Source

File: bp-core/classes/class-bp-attachment-avatar.php

179
180
181
182
183
184
185
186
187
188
189
public static function is_too_small( $file = '' ) {
    $uploaded_image = @getimagesize( $file );
    $full_width     = bp_core_avatar_full_width();
    $full_height    = bp_core_avatar_full_height();
 
    if ( isset( $uploaded_image[0] ) && $uploaded_image[0] < $full_width || $uploaded_image[1] < $full_height ) {
        return true;
    }
 
    return false;
}

Changelog

Changelog
Version Description
BuddyPress 2.3.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.