(non-PHPdoc)
@see n2n\io\img.ImageFileWrapper::createResource()
771763
public function createImageResource($keepHandleAlive = false): ImageResource {
		$resource = IoUtils::imageCreateFromPng($this->filePath);
		
		imagealphablending($resource, false);
		
		return new ImageResource($resource, $keepHandleAlive);
	}
677061
function createResource(url, params, methods) {
      var resource;

      params = _.defaults({}, params, defaultParams);
      methods = _.defaults({}, methods, defaultMethods);
      resource = $resource(url, params, methods);

      // overwrite $save to automatically call $create or $update
      resource.prototype.$save = function save() {
        if (!this._id) {
          return this.$create();
        }

        return this.$update();
      };

      return resource;
    }
1129273
public function generate(Resource $resource, array $data = array()) : void
    {
        $filepath  = $resource->getSrcFilename();
        $name      = $data['name'];
        $arguments = $data['arguments'];

        $argString = $this->argumentBuilder->buildFrom($arguments);

        $values = array('%name%' => $name, '%arguments%' => $argString);
        if (!$content = $this->templates->render('method', $values)) {
            $content = $this->templates->renderString(
                $this->getTemplate(), $values
            );
        }

        $code = $this->filesystem->getFileContents($filepath);
        $code = preg_replace('/}[ \n]*$/', rtrim($content) ."\n}\n", trim($code));
        $this->filesystem->putFileContents($filepath, $code);

        $this->io->writeln(sprintf(
                "\n<info>Method <value>%s::%s()</value> has been created.</info>",
                $resource->getSrcClassname(), $name
            ), 2);
    }
150742
public static function create($contentDescription = null, $imageSources = []): self
    {
        $image = new self();

        $image->contentDescription = $contentDescription;
        $image->sources            = $imageSources;

        return $image;
    }
730943
public static function createStreamForScalarResource($resource, array $options = [])
    {
        $stream = fopen('php://temp', 'r+');
        if ($resource !== '') {
            fwrite($stream, $resource);
            fseek($stream, 0);
        }

        return new Stream($stream, $options);
    }
179390
public static function create( $file = null, $data = null, $encode = false ) 
	{
		$view = parent::create( static::view_namespace().'::'.$file, $data, $encode );
		
		// set the asset holder path
		\CCAsset::holder( 'theme' )->path = static::public_namespace();
		
		// set the vendor path
		\CCAsset::holder( 'vendor' )->path = 'assets/vendor/';
		
		// you may ask why not just return the parent::create(bla bla.. directly?
		// i actually wanted to do something with that var view. So if you'r still
		// able to read this i completly forgot it.
		return $view;
	}
684283
public function make()
    {
        $ext = strtolower(strrchr($this->path, '.'));
        $path = storage_path('app/public/') . $this->path;
        switch ($ext) {
            case '.jpg':
            case '.jpeg':
                $this->image = @imagecreatefromjpeg($path);
                break;
            case '.gif':
                $this->image = @imagecreatefromgif($path);
                break;
            case '.png':
                $this->image = @imagecreatefrompng($path);
                break;
            default:
                $this->image = false;
                break;
        }

        if (false === $this->image) {
            throw new ImageNotFoundException('Image extension not supported!');
        }
        $this->width = imagesx($this->image);
        $this->height = imagesy($this->image);

        return $this;
    }
1098958
public function createImageResource($keepHandleAlive = false): ImageResource {
		return new ImageResource(IoUtils::imageCreateFromGif($this->filePath), $keepHandleAlive);
	}
1196258
static void createFileFromResource(String resource, Resource file, String password) throws IOException {
	SystemOut.printDate(SystemUtil.getPrintWriter(SystemUtil.OUT), "write file:" + file);
	file.delete();

	InputStream is = InfoImpl.class.getResourceAsStream(resource);
	if (is == null) throw new IOException("file [" + resource + "] does not exist.");
	file.createNewFile();
	IOUtil.copy(is, file, true);
    }
1065685
public static File createTmpPhpFileFromResource(String resourceName, boolean deleteOnExit) throws IOException {
		InputStream is = getInstance().getClass().getResourceAsStream(resourceName);
		if (is == null) {
			throw new IOException("Unable to find php file " + resourceName);
		}
		return copyFile(is, deleteOnExit);
	}
318157
protected function createResourceRepository(
        $class,
        DocumentManager $documentManager,
        ClassMetadata $metadata,
        ResourceInterface $resource = null
    ) {
        if ($resource !== null && is_a($class, BaseRepositoryInterface::class, true)) {
            return new $class($documentManager, $documentManager->getUnitOfWork(), $metadata, $resource);
        }

        return parent::createRepository($documentManager, $metadata->getName());
    }
810705
public function createImgSet(File $file = null, N2nContext $n2nContext): ImgSet {
		if ($file === null || !$file->isValid()) {
			return $this->createPlaceholderImgSet();
		}

		$orgImageFile = new ImageFile($file);
	
		$thumbFile = null;
		$imageFiles = array();
		foreach ($this->getWidths() as $width) {
			if ($thumbFile === null) {
				$imageFiles[$width] = $thumbFile = $this->createThumb($orgImageFile, $width);
				continue;
			}
	
			if (null !== ($imageFile = $this->buildVariation($thumbFile, $width, $orgImageFile))) {
				$imageFiles[$width] = $imageFile;
			}
		}
	
		$lastSize = null;
		$lastWidth = null;
		foreach ($imageFiles as $width => $imageFile) {
			if ($width > $this->maxWidth || $width < $this->minWidth) continue;
	
			// 			$size = $imageFile->getFile()->getFileSource()->getSize();
			// 			if (!$this->isSizeGabTooLarge($lastWidth, $lastWidth = $size)) continue;
	
			// 			if ($lastSize > $size) {
	
			// 			}
		}
	
		$imgSrcs = array();
		foreach ($imageFiles as $width => $imageFile) {
			$imgSrcs[$width . 'w'] = UiComponentFactory::createImgSrc($imageFile);
		}
		
		$imageSourceSets = array();
		if (count($imgSrcs) > 1 || $this->sizesAttr !== null) {
			$imageSourceSets = array(new ImageSourceSet(array_reverse($imgSrcs, true), null, array('sizes' => $this->sizesAttr)));
		}
		
		$defaultImageFile = reset($imageFiles);
		return new ImgSet(reset($imgSrcs), '', $defaultImageFile->getWidth(),
				$defaultImageFile->getHeight(), $imageSourceSets);
	}
1062746
private function imagecreatefrompsd($fileName)
		# Author:     Tim de Koning
		# Version:    1.3
		# Purpose:    To create an image from a PSD file.
		# Param in:   PSD file to open.
		# Param out:  Return a resource like the other ImageCreateFrom functions
		# Reference:  http://www.kingsquare.nl/phppsdreader
		# Notes:
		#
	{
		if (file_exists($this->psdReaderPath))
		{


			include_once($this->psdReaderPath);

			$psdReader = new PhpPsdReader($fileName);

			if (isset($psdReader->infoArray['error']))
			{
				return '';
			}
			else
			{
				return $psdReader->getImage();
			}
		}
		else
		{
			return false;
		}
	}
1024034
public static function createFromResource($resource): Stream
    {
        if (!\is_resource($resource))
        {
            throw new \InvalidArgumentException('Stream must be a resource');
        }

        $obj           = new self();
        $obj->stream   = $resource;
        $meta          = stream_get_meta_data($obj->stream);
        $obj->seekable = $meta['seekable'];
        $obj->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
        $obj->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
        $obj->uri      = $obj->getMetadata('uri');

        return $obj;
    }
1259853
private function createImagineInstance()
    {
        try {
            if (ImagerService::$imageDriver === 'gd') {
                return new \Imagine\Gd\Imagine();
            }

            if (ImagerService::$imageDriver === 'imagick') {
                return new \Imagine\Imagick\Imagine();
            }
        } catch (RuntimeException $e) {
            // just ignore for now
        }

        return null;
    }
819067
public function createResizedImage(Image $file, $targetWidth, $targetHeight, $cropped = false, $quality = 95, $force = false)
	{
		// validate params
		if ( ! $file instanceof Image) {
			throw new Exception\RuntimeException('Image entity expected');
		}
		if (($targetWidth <= 0) || ($targetHeight <= 0)) {
			throw new Exception\RuntimeException('Dimensions are invalid');
		}

		$sizeName = $this->getImageSizeName($targetWidth, $targetHeight, $cropped);

		if ( ! $this->fileExists($file)) {
			$this->container->getLogger()->warn("Image '{$file->getFileName()}' is missing in the filesystem, tried to resize to {$sizeName}");

			return $sizeName;
		}

		$size = $file->getImageSize($sizeName);

		if (($size->getTargetHeight() == $targetHeight)
				&& ($size->getTargetWidth() == $targetWidth)
				&& ($size->getQuality() == $quality)
				&& ($size->getCropMode() == $cropped)
				&& empty($force)
		) {
			// nothing to update
			return $sizeName;
		}

		$size->setQuality($quality);
		$size->setCropMode($cropped);
		$size->setTargetWidth($targetWidth);
		$size->setTargetHeight($targetHeight);

		$originalFilePath = $this->getFilesystemPath($file, true);

		// initiate resizer
		$resizer = $this->getImageResizer();

		$resizer->setSourceFile($originalFilePath)
				->setOutputQuality($quality)
				->setTargetWidth($targetWidth)
				->setTargetHeight($targetHeight)
				->setCropMode($cropped);

		$expectedSize = $resizer->getExpectedSize();
		$size->setWidth($expectedSize['width']);
		$size->setHeight($expectedSize['height']);

		$resizedFileDir = $this->getFilesystemDir($file)
				. self::RESERVED_DIR_SIZE . DIRECTORY_SEPARATOR
				. $size->getFolderName();

		if ( ! file_exists($resizedFileDir)) {
			$mkdirResult = mkdir($resizedFileDir, $this->folderAccessMode, true);
			if (empty($mkdirResult)) {
				throw new Exception\RuntimeException(
						'Could not create directory for resized image');
			}
		}

		$resizedFilePath = $resizedFileDir . DIRECTORY_SEPARATOR . $file->getRealFileName();
		$resizer->setOutputFile($resizedFilePath);
		$resizer->process();

		$entityManager = $this->getDoctrineEntityManager();

		$entityManager->persist($size);
		$entityManager->flush();

		return $sizeName;
	}
171069
public static function FromImageResource( $imageResource ) : Rectangle
   {

      return new Rectangle(
         new Point(),
         new Size( \imagesx( $imageResource ), \imagesy( $imageResource ) )
      );

   }