BP_GOPP_Image_Editor_GS::load()

Checks validity and existence of file and sets mime type and calls set_resolution and set_page and set_quality (firing filters).

Description

Return

(true|WP_Error) True if loaded; WP_Error on failure.

Source

File: bp-document/classes/class-bp-gopp-image-editor-gs.php

	public function load() {
		if ( true !== ( $result = self::gs_valid( $this->file ) ) ) {
			return new WP_Error( 'invalid_image', $result, $this->file );
		}

		list( $filename, $extension, $mime_type ) = $this->get_output_format( $this->file );
		$this->mime_type                          = $mime_type;

		// Allow chance for gopp_editor_set_resolution filter to fire by calling set_resolution() with null arg (mimicking set_quality() behavior).
		if ( is_wp_error( $result = $this->set_resolution() ) ) {
			return $result;
		}

		// Similarly for page to render.
		if ( is_wp_error( $result = $this->set_page() ) ) {
			return $result;
		}

		return $this->set_quality();
	}

Changelog

Changelog
Version Description
BuddyBoss 1.4.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.