Return string of IMG tag with base64 decoded string

@param array $data Data of photo.
@param bool $returnTableRow If True, add class `center-block`.
@param int $size Size of image in px.
@return string Return HTML tag IMG.
439119
public function getPhotoImage($data = null, $returnTableRow = true, $size = 0) {
		$result = $this->_getValueForPhotoImageBase($data, $returnTableRow, $size);

		return $result;
	}
370489
public function returnData($data,$returnType = null,$option = null)
	{
		if(null === $returnType)
		{
			$returnType = Config::get('@.CONTROL_RETURN_TYPE');
		}
		$returnType = strtolower($returnType);
		if('json' === $returnType)
		{
			Response::setMime('json');
			exit(json_encode($data,null === $option?0:$option));
		}
		else if('xml' === $returnType)
		{
			Response::setMime('xml');
			exit(XML::toString($data));
		}
		else if('html' === $returnType)
		{
			Response::setMime('html');
			echo $data;
		}
		else
		{
			$eventData = array('data'=>$data,'returnType'=>$returnType,'option'=>$option);
			Event::trigger('YURUN_RETURN_DATA',$eventData);
		}
	}
423748
public function renderRow($row, array $data = [])
    {
        if (is_string($row)) {
            if (null === $element = $this->editor->getRepository()->findRowByName($row)) {
                $this->persist($element = $this->editor->getRowManager()->create($row, $data));
            }
            $row = $element;
        }

        if ($row instanceof EM\RowInterface) {
            $this->tagManager->addTags($row->getEntityTag());

            $row = $this->editor->getViewBuilder()->buildRow($row);
        }

        if (!$row instanceof View\RowView) {
            throw new Exception\InvalidArgumentException(
                'Expected string or instance of ' .
                EM\RowInterface::class . ' or ' .
                View\RowView::class
            );
        }

        /** @noinspection PhpInternalEntityUsedInspection */
        return $this->getTemplate()->renderBlock('cms_row', [
            'row' => $row,
        ]);
    }
1032833
public function getValue($row, Table $table) {
        $image = $this->getHTMLImage($row, $table);
        if (!$this->href) {
            return $image;
        }
        $href = "";
        if (is_string($this->href)) {
            eval("\$href = {$this->href}");
        } elseif (is_callable($this->href)) {
            $href = call_user_func($this->href, $row, $table);
        }
        return ("" != ($r = Html::get()->link($href, $image, $this->linkHtmlOptions))) ? $r : $image;
    }
1073891
public static function getImageFromArray($data, $size, $dimensions = false)
    {
        if($dimensions === true)
        {
            $image = (object) [
                'url' => $data['sizes'][$size],
                'width' => $data['sizes'][$size . '-width'],
                'height' => $data['sizes'][$size . '-height']
            ];
        }
        else
        {
            $image = $data['sizes'][$size];
        }
        return $image;
    }
995442
public function returnMetadata($returnMetadata = null) {
        if ($returnMetadata === null) {
            return $this->returnMetadata;
        }

        $this->returnMetadata = (bool) $returnMetadata;

        return $this;
    }
189640
private function decodeDataUrl($data_url)
    {
        if (!is_string($data_url)) {
            return null;
        }

        $pattern = "/^data:(?:image\/[a-zA-Z\-\.]+)(?:charset=\".+\")?;base64,(?P<data>.+)$/";
        preg_match($pattern, $data_url, $matches);

        if (is_array($matches) && array_key_exists('data', $matches)) {
            return base64_decode($matches['data']);
        }

        return null;
    }
1369614
public function getImageSrc($size = null)
    {
        $owner = $this->owner;

        $prefix = '';
        if (Yii::$app->request instanceof \yii\web\Request) {
            $prefix = Yii::$app->request->baseUrl;
            $host = Yii::$app->request->hostInfo;
            // If current application is backend - return absolute frontend image path
            if (!empty($this->_backendSubdomain) && strpos($host, $this->_backendSubdomain) !== false) {
                $prefix = str_replace($this->_backendSubdomain, '', $host) . $prefix;
            }
            if (!empty($this->_backendRoute) && strpos($prefix, $this->_backendRoute) !== false) {
                $prefix = str_replace($this->_backendRoute, '', $prefix);
            }
        }

        $image = $owner->{$this->_imageAttribute};
        if (empty($image)) {
            if (isset($this->getImageSizes()[$size])) {
                return $prefix . '/images/' . static::addPrefixToFile($this->_noImageBaseName, $size);
            }

            return $prefix . '/images/' . $this->_noImageBaseName;
        }

        $root = Yii::getAlias($this->_rootPathAlias); // Webroot
        $path = Yii::getAlias($this->_savePathAlias); // Uploading dir
        $path = str_replace($root, '', $path); // Remove server path
        $path = str_replace('\\', '/', $path); // Replace "\" to "/"
        $folder = $prefix . '/' . trim($path, '/') . '/';

        if (!empty($size)) {
            return $folder . static::addPrefixToFile($image, $size);
        } else {
            return $folder . $image;
        }
    }
845317
public static function image($itemId, $size)
    {
        if(has_post_thumbnail($itemId))
        {
            return wp_get_attachment_image_src(
                get_post_thumbnail_id($itemId), $size
            )[0];
        }

        return false;
    }
637368
public function img($srcImagePath, $size = null, $options = []) {
        return Html::img(self::imgSrc($srcImagePath, $size), $options);
    }
116219
public function getReverseImagesQuery($data, $inputs)
    {
        foreach ($inputs as $input) {
            $data[] = ['output' => $this->setData(['image' => ['url' => $input->getImage()]], 'input')];
        }

        return $data;
    }
1024342
protected function find_image_size_from_width( $sizes, $width ) {
		foreach ( $sizes as $name => $size ) {
			if ( $width === $size['width'] ) {
				return $name;
			}
		}
		return null;
	}
652327
public static function decode(String $data, Bool $array = false, Int $length = 512)
    {
        $return = json_decode($data, $array, $length);

        return $return;
    }
1069273
protected function getData($dataRow)
    {
        $data = [];
        $relateTable = $this->getParentTableName();
        $regexp = "/{$relateTable}_(?P<name>.+)/i";
        foreach ($dataRow as $field => $value) {
            if (preg_match($regexp, $field, $matched)) {
                $data[$matched['name']] = $value;
            }
        }
        return $data;
    }
828752
public function getAvatarTag($size = 96, $alt = null)
    {
        return get_avatar($this->getId(), $size, null, $alt ?: $this->getDisplayName());
    }
1287800
public function insertRecord(array $data, $returnData = false)
    {
        $countedRecords = count($this->getRecords());
        $data[$this->primaryKey] = $countedRecords > 1 ? $countedRecords + 1 : 1;
        $this->database->getReference()
            ->getChild($this->table)
            ->getChild($countedRecords)
            ->set($data);

        if ($returnData) {
            return $this->getRecord($data[$this->primaryKey]);
        }

        return $this;
    }
798610
public function success($message = null, $data = array(), $return = false)
    {
        if (!empty($data)) {
            foreach ($data as $key => $value) {
                $this->add($key, $value);
            }
        }
        $json = $this->jsonEncode(
            array(
                'success' => true,
                'message' => $message,
                'data' => $this->_data,
            )
        );
        if (!$return) {
            echo $json;
            Yii::app()->end();
        } else {
            return $json;
        }
    }