Rebuild the images for this attachment.

@return void
345225
public function reprocess()
	{
		if (!$this->originalFilename()) {
			return;
		}

		foreach ($this->styles as $style) 
		{
			$fileLocation = $this->storage == 'filesystem' ? $this->path() : $this->url();
			$file = $this->IOWrapper->make($fileLocation);

			if ($style->value && $file->isImage()) {
				$file = $this->resizer->resize($file, $style);
			}
			else {
				$file = $file->getRealPath();
			}

			$filePath = $this->path($style->name);
			$this->move($file, $filePath);
		}
	}
454295
protected function rebuildCache()
    {
        $this->cache = stream_get_meta_data($this->stream);
        $this->cache[self::IS_LOCAL] = stream_is_local($this->stream);
        $this->cache[self::IS_READABLE] = isset(self::$readWriteHash['read'][$this->cache['mode']]);
        $this->cache[self::IS_WRITABLE] = isset(self::$readWriteHash['write'][$this->cache['mode']]);
    }
1233196
protected function removeAllImages()
    {
        //Delete old images
        $obImageList = $this->obModel->images;
        if ($obImageList->isEmpty()) {
            return;
        }

        /** @var \System\Models\File $obFile */
        foreach ($obImageList as $obFile) {
            $obFile->deleteThumbs();
            $obFile->delete();
        }
    }
520034
protected function imageProcess()
    {
        if ($this->saved) {
            if (!$this->image)  $this->image = ImageManager::make($this->saved);

            if ($this->image_callable) {
                $callable = $this->image_callable;
                $callable($this->image);
            }

            if (count($this->resize)) {
                foreach ($this->resize as $resize) {
                    $this->image->resize($resize["width"], $resize["height"]);
                    $this->image->save($this->parseString($resize["filename"]));
                }
            }

            if (count($this->fit)) {
                foreach ($this->fit as $fit) {
                    $this->image->fit($fit["width"], $fit["height"]);
                    $this->image->save($this->parseString($fit["filename"]));
                }
            }

        }
    }
1308103
protected function reopenArchive()
	{
		$path = $this->archive->filename;
		$this->archive->close();
		$this->openArchive($path);
	}
696168
public function afterDelete()
    {
        if ($this->cover)
        {
            /** @var Gallery_Entity_Table_Image $table  */
            $table = $this->getTable();
            $table->autoSetCover($this->section);
        }
    }
916852
public function rebuild()
	{
		// Get an instance of the table object.
		$table = $this->getTable();

		if (!$table->rebuild())
		{
			$this->setError($table->getError());

			return false;
		}

		// Clear the cache
		$this->cleanCache();

		return true;
	}
790406
protected function renderResource(): void
    {
        $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());
        $this->resource = $processedImageInfo['resource'];
        $this->width = $processedImageInfo['width'];
        $this->height = $processedImageInfo['height'];
        $this->persistenceManager->whitelistObject($this->resource);
    }
971148
private function rebuildUrl()
    {
        $url = self::buildUrl([
                'scheme' => $this->scheme,
                'host'   => $this->host,
                'port'   => $this->port,
                'path'   => $this->path,
                'query'  => $this->query
            ]
        );
        $this->val($url->val());
        return $this;
    }
260775
public function reset()
  {
      $this->values[self::URL] = null;
      $this->values[self::MIMETYPE] = null;
      $this->values[self::NAME] = null;
      $this->values[self::LENGTH] = null;
      $this->values[self::SHA256] = null;
      $this->values[self::UNK_2] = null;
      $this->values[self::REFKEY] = null;
      $this->values[self::FILENAME] = null;
      $this->values[self::THUMBNAIL] = null;
  }
328633
public function build()
    {
        $files = $this->iterator->getFiles();
        $generators = $this->generatorRegistry->generators();

        foreach ($files as $file) {
            foreach ($generators as $generator) {
                $generator->parseFile($file);
            }
        }

        foreach ($generators as $generator) {
            $generator->generate();
        }
    }
45239
protected function updateImageStyle()
    {
        $this->controlAccess('image_style_edit');

        if ($this->image_style->update($this->data_imagestyle['imagestyle_id'], $this->getSubmitted())) {
            $this->image_style->clearCache($this->data_imagestyle['imagestyle_id']);
            $this->redirect('admin/settings/imagestyle', $this->text('Image style has been updated'), 'success');
        }

        $this->redirect('', $this->text('Image style has not been updated'), 'warning');
    }
464386
public function rebuildTree()
    {
        $em = $this->getEntityManager();

        // Reset tree...
        $sql = 'UPDATE kuma_folders SET lvl=NULL,lft=NULL,rgt=NULL';
        $stmt = $em->getConnection()->prepare($sql);
        $stmt->execute();

        $folders = $this->findBy(array(), array('parent' => 'ASC', 'name' => 'asc'));

        $rootFolder = $folders[0];
        $first = true;
        foreach ($folders as $folder) {
            // Force parent load
            $parent = $folder->getParent();
            if (is_null($parent)) {
                $folder->setLevel(0);
                if ($first) {
                    $this->persistAsFirstChild($folder);
                    $first = false;
                } else {
                    $this->persistAsNextSiblingOf($folder, $rootFolder);
                }
            } else {
                $folder->setLevel($parent->getLevel() + 1);
                $this->persistAsLastChildOf($folder, $parent);
            }
        }
        $em->flush();
    }
47850
public function actionResize()
    {
        $models = Mediafile::findByTypes(Mediafile::$imageFileTypes);
        $routes = $this->module->routes;

        foreach ($models as $model) {
            if ($model->isImage()) {
                $model->deleteThumbs($routes);
                $model->createThumbs($routes, $this->module->thumbs);
            }
        }

        Yii::$app->session->setFlash('successResize');
        $this->redirect(Url::to(['default/settings']));
    }
112098
private function generateAssets()
    {
        $sourceDir = $this->skeletonDir;

        $relPath = '/Resources/ui/';
        $this->copyFiles($sourceDir . $relPath, $this->getAssetsDir($this->bundle) . '/ui', true);
        $this->renderFiles(
            $sourceDir . $relPath . '/js/',
            $this->getAssetsDir($this->bundle) . '/ui/js/',
            array('bundle' => $this->bundle, 'demosite' => $this->demosite),
            true
        );
        $this->renderFiles(
            $sourceDir . $relPath . '/scss/',
            $this->getAssetsDir($this->bundle) . '/ui/scss/',
            array('bundle' => $this->bundle, 'demosite' => $this->demosite),
            true
        );

        if (!$this->demosite) {
            // Files
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/files/');

            // Images
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/fonts/');

            // JS
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/js/search.js');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/js/demoMsg.js');

            // Images
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/demosite/');
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/buttons/');
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/dummy/');
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/img/backgrounds/');

            // SCSS
            // SCSS - Blocks
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/blocks/_img-icon.scss');

            // SCSS - Forms
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/forms/_form-widget.scss');

            // SCSS - Structures
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_splash.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/splash.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_submenu.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/submenu.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_blog-item.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/blog-item.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/blog-item-summary.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_search-results.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/search-results.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_breadcrumb-nav.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/breadcrumb.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_header-visual.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/header-visual.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_newsletter.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/newsletter.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_pagination.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/docs/pagination.md');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/structures/_demosite-msg.scss');

            // SCSS - Header
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_main-nav.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_site-nav.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_language-nav.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_contact-nav.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/header/_search-form.scss');

            // SCSS - Footer
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/footer/_social-footer.scss');

            // SCSS - Pageparts
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/components/pageparts/_service-pp.scss');

            // SCSS - Config
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/config/vendors/_cargobay-imports.scss');
            $this->removeFile($this->getAssetsDir($this->bundle) . '/ui/scss/config/vendors/_cargobay-vars.scss');

            // SCSS - Mixins
            $this->removeDirectory($this->getAssetsDir($this->bundle) . '/ui/scss/helpers/mixins/');
        }

        $relPath = '/Resources/admin/';
        $this->copyFiles($sourceDir . $relPath, $this->getAssetsDir($this->bundle) . '/admin', true);

        $this->assistant->writeLine('Generating ui assets : <info>OK</info>');
    }
1219048
public function remountElements()
    {
        $columns = [];
        foreach ($this->columns as $column) {
            $columns[$column->getName()] = $column;
        }

        $indexes = [];
        foreach ($this->indexes as $index) {
            $indexes[$index->getName()] = $index;
        }

        $foreignKeys = [];
        foreach ($this->foreignKeys as $foreignKey) {
            $foreignKeys[$foreignKey->getName()] = $foreignKey;
        }

        $this->columns = $columns;
        $this->indexes = $indexes;
        $this->foreignKeys = $foreignKeys;
    }
410050
public function processThumbnails()
    {
        foreach ($this->findFiles(['is_hidden' => false, 'is_deleted' => false]) as $file) {
            if ($file->isImage) {
                // create tiny thumbnail
                $this->createImage($file->id, $this->getFilterId(TinyCrop::identifier()));
                $this->createImage($file->id, $this->getFilterId(MediumThumbnail::identifier()));
            }
        }

        // force auto fix
        $this->autoFixMissingImageSources = true;

        foreach ($this->findImages() as $image) {
            if (!empty($image->file) && !$image->file->isHidden && !$image->file->isDeleted) {
                $image->source; // which forces to recreate missing sources.
            }
        }

        return true;
    }