_save example



        if ( ! isset( $size_data['crop'] ) ) {
            $size_data['crop'] = false;
        }

        $resized = $this->_resize( $size_data['width']$size_data['height']$size_data['crop'] );

        if ( is_wp_error( $resized ) ) {
            $saved = $resized;
        } else {
            $saved = $this->_save( $resized );
            imagedestroy( $resized );
        }

        $this->size = $orig_size;

        if ( ! is_wp_error( $saved ) ) {
            unset( $saved['path'] );
        }

        return $saved;
    }

    


        if ( ( $this->size['width'] === $size_data['width'] ) && ( $this->size['height'] === $size_data['height'] ) ) {
            return new WP_Error( 'image_subsize_create_error', __( 'The image already has the requested size.' ) );
        }

        $resized = $this->resize( $size_data['width']$size_data['height']$size_data['crop'] );

        if ( is_wp_error( $resized ) ) {
            $saved = $resized;
        } else {
            $saved = $this->_save( $this->image );

            $this->image->clear();
            $this->image->destroy();
            $this->image = null;
        }

        $this->size  = $orig_size;
        $this->image = $orig_image;

        if ( ! is_wp_error( $saved ) ) {
            unset( $saved['path'] );
        }
Home | Imprint | This part of the site doesn't use cookies.