Image replacement

@return  string
350135
private function _mozifyImageReplacement()
	{
		//get the class
		$class = $this->getCssClassName();

		//build replacement html
		$replacement  = '<table width="' . $this->imageWidth . '" cellspacing="0" cellpadding="0" border="0" align="" moz="3" style="display:block;float:none" class="' . $class . '">';
		$replacement .= '<tbody>';
		$replacement .= '<tr>';
		$replacement .= '<td style="padding:0px 0px 0px 0px;" class="' . $class . '">';
		$replacement .= '<div class="' . $class . '" style="width:0px;height:0px;overflow:visible;float:left;position:absolute">';
		$replacement .= '<table cellspacing="0" cellpadding="0" class="' . $class . '">';
		$replacement .= '<tbody>';
		$replacement .= '<tr>';
		$replacement .= '<td background="' . $this->imageUrl . '"><div class="' . $class . '" style="width:' . $this->imageWidth . 'px;height:' . $this->imageHeight . 'px"></div></td>';
		$replacement .= '</tr>';
		$replacement .= '</tbody>';
		$replacement .= '</table>';
		$replacement .= '</div>';
		return $replacement;
	}
338176
private function replace()
    {
        $destination = Yii::getAlias($this->destination);
        $destinationModuleName = $this->getDestinationModuleName();
        $counter = 0;
        $files = FileHelper::findFiles($destination);
        asort($files);
        foreach ($files as $path) {
            if (!$this->replace && in_array($path, $this->keepFiles)) {
                continue;
            }
            if (!preg_match('/^.*\.php$/', $path, $matches)) { // php file.
                continue;
            } else if (preg_match('/^.*\W([A-Z]\w+)\.php$/', $path, $matches)) { // Class file.
                file_put_contents($path, $this->createClassContent($matches[1], $path));
            } else if (self::isMigration($path)) { // Class file.
                $counter++;
                file_put_contents($path, $this->updateFileContent($path));
                if ($destinationModuleName) {
                    $this->renameClassFile($path, function($className) use ($destinationModuleName, $counter){
                        $time = time() + $counter;
                        return preg_replace('#^m(\d+_\d+)_(.+)$#', 'm'.date('ymd_His', $time).'_'.$destinationModuleName.'_$2', $className);
                    });
                }
            } else if ($this->inherit) {
                file_put_contents($path, $this->createFileContent($path));
            } else {
                file_put_contents($path, $this->updateFileContent($path));
            }
        }
        return true;
    }
225042
public function getImage()
    {
        // No fields, no image.
        if (empty($this->contenttype['fields'])) {
            return '';
        }

        // Grab the first field of type 'image', and return that.
        foreach ($this->contenttype['fields'] as $key => $field) {
            if ($field['type'] === 'image' && isset($this->values[$key])) {
                // After v1.5.1 we store image data as an array
                if (is_array($this->values[$key])) {
                    return isset($this->values[$key]['file']) ? $this->values[$key]['file'] : '';
                }

                return $this->values[$key];
            }
        }

        // otherwise, no image.
        return '';
    }
114183
public function getMetaImage()
    {
        $metaImage = $this->getTranslationAttribute('meta_image');

        if ($metaImage = get_nuclear_cover($metaImage))
        {
            return $metaImage;
        }

        if ($coverImage = $this->getCoverImage())
        {
            return $coverImage;
        }

        return null;
    }
798027
public function lostImage()
    {
        $imagePath = app(AssetService::class)->generateImage('File Not Found');

        $image = InterventionImage::make($imagePath)->resize(config('cms.preview-image-size', 800), null, function ($constraint) {
            $constraint->aspectRatio();
        });

        return (string) $image->encode('data-url');
    }
523783
public function imageToHtml()
    {
        if (empty($this->data['file.url'])) {
            return '';
        }

        $text = $this->data['text'] ?? '';

        if (!empty($text)) {
            $text = $this->parser->toHtml($text);
        }

        $url = $this->data['file.url'] ?? '';

        try {
            $size = getimagesize($url);
        } catch (Exception $e) {
            $size = [
                $this->config['image.width'] ?? 520,
                $this->config['image.height'] ?? 200,
            ];
        }

        return $this->view('image.image', [
            'url' => $url,
            'text' => $text,
            'width' => $size[0],
            'height' => $size[1],
        ]);
    }
865730
public function getIsImage()
    {
        // Check file type
        $mime = $this->getMimeType();
        return $mime && in_array($mime, $this->config()->supported_images);
    }
513553
private function getUrlTemplate()
    {
        $filter = $this->getFilter();
        $item   = current($this->getFilter()->getItems());

        $regexp      = "/({$filter->getRequestVar()})=(-?[0-9]+)/";
        $replacement = '${1}=<%- from %>-<%- to %>';

        return preg_replace($regexp, $replacement, $item->getUrl());
    }
932336
public function getThumbnail(): Imagick
    {
        $image = new Imagick($this->file->getPathname().'[0]');
        $image->setImageFormat('png');

        return $image;
    }
511954
public function MicroImage()
    {
        $pixel = $this->config()->pixelate;
        $blur = $this->config()->blur;
        $quality = $this->config()->quality;
        $scale = $this->config()->scale;
        
        $variant = $this->owner->variantName(__FUNCTION__, $pixel, $blur, $quality, $scale);
        return $this->owner->manipulateImage(
            $variant, 
            function (Image_Backend $backend) use ($pixel, $blur, $quality, $scale) {
                $clone = clone $backend;
                $resource = clone $backend->getImageResource();
                $resource->pixelate($pixel)->blur($blur)->encode('jpg', $quality);
                if ($scale != 100) {
                    $width = $backend->getWidth() * ($scale/100);
                    $height = $backend->getHeight() * ($scale/100);
                    $resource->resize($width, $height);
                }
                $clone->setImageResource($resource);
                return $clone;
            }
        );
    }
38476
private function getImage()
    {
        $image = $this->_parser->find('.container-left .user-profile', 0);
        $image = $image->find('.user-image img', 0);

        return $image ? Helper::imageUrlCleaner($image->src) : '';
    }
1000606
public function imgNotFound()
    {
        $file = 'img-not-found.png';
        if (!Storage::exists($file)) {
            Storage::put($file, File::get(public_path('img/'.$file)));
        }

        return $file;
    }
201562
public function PrimaryImage()
    {
        // If we have associated an image, return it
        $image = $this->owner->Image();

        if ($image->exists()) {
            return $image;
        }

        // Next try and get a child product image
        $product = $this->owner->AllProducts()->first();

        if (!empty($product)) {
            return $product->PrimaryImage();
        }

        // Finally generate our no product image
        return Helper::generate_no_image();
    }
1315407
public function searchAndReplace()
	{
		$this->search();

		$this->replacement = new Replacement($this->formatted, $this->str);

		$this->replacement->replace();
		
		return $this->replacement->getStr();
	}
351314
public function getImages()
    {
        // Sort array
        $images = array();
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) {
            $images[self::IMAGE_HEADER_LEFT] =         $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) {
            $images[self::IMAGE_HEADER_CENTER] =     $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
        }
        if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
            $images[self::IMAGE_HEADER_RIGHT] =     $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
            $images[self::IMAGE_FOOTER_LEFT] =         $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
            $images[self::IMAGE_FOOTER_CENTER] =     $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
        }
        if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
            $images[self::IMAGE_FOOTER_RIGHT] =     $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
        }
        $this->headerFooterImages = $images;

        return $this->headerFooterImages;
    }
454547
public function getImageAttribute()
    {
        if ($this->thumbnail and $this->thumbnail->attachment) {
            return $this->thumbnail->attachment->guid;
        }
    }
1070359
public function gettyimagesToHtml()
    {
        return $this->view('image.gettyimages', [
            'remote_id' => $this->data['remote_id'],
            'width' => $this->config['gettyimages.width'] ?? 594,
            'height' => $this->config['gettyimages.height'] ?? 465,
            'placeholder' => $this->config['gettyimages.placeholder'] ?? '/',
        ]);
    }