private function timber_should_resize( $attachment_parent_id, $img_size ) {
		/**
		 * Normally we don’t have a post type associated with the attachment
		 *
		 * We use an empty array to tell the function that there is no post type
		 * associated with the attachment.
		 */
		$attachment_post_type = array( '' );

		// Check if image is attached to a post and sort out post type
		if ( 0 !== $attachment_parent_id ) {
			$parent               = get_post( $attachment_parent_id );
			$attachment_post_type = array( $parent->post_type );
		}

		return self::is_size_for_post_type( $img_size, $attachment_post_type );
	}
private function timber_should_resize( $attachment_parent_id, $img_size ) {
		/**
		 * Normally we don’t have a post type associated with the attachment
		 *
		 * We use an empty array to tell the function that there is no post type
		 * associated with the attachment.
		 */
		$attachment_post_type = array( '' );

		// Check if image is attached to a post and sort out post type
		if ( 0 !== $attachment_parent_id ) {
			$parent               = get_post( $attachment_parent_id );
			$attachment_post_type = array( $parent->post_type );
		}

		return self::is_size_for_post_type( $img_size, $attachment_post_type );
	}
private function timber_should_resize ( $ attachment_parent_id , $ img_size ) { /**
		 * Normally we don’t have a post type associated with the attachment
		 *
		 * We use an empty array to tell the function that there is no post type
		 * associated with the attachment.
		 */ $ attachment_post_type = array ( '' ) ; // Check if image is attached to a post and sort out post type if ( 0 !== $ attachment_parent_id ) { $ parent = get_post ( $ attachment_parent_id ) ; $ attachment_post_type = array ( $ parent -> post_type ) ; } return self :: is_size_for_post_type ( $ img_size , $ attachment_post_type ) ; }
Check if we should pregenerate an image size based on the image configuration.

@param  int   $attachment_parent_id Parent ID of the attachment.
@param  array $img_size             The image configuration array.

@return bool Whether the image should or can be resized.
Check if we should pregenerate an image size based on the image configuration .