Sets the image being edited

@param string $orig the file path to the image being edited
@param string $dest optional, the file path to name the edited file should be saved as, without this the original file gets saved over with the edited version
18456
public function set($orig, $dest='')
    {
        if(!empty($dest)){
            copy($orig, $dest);
            $orig = $dest;
        }

        $this->path = $orig;
        $this->getInfo();

    }
1163105
public static function copyTo(StreamInterface $src, $dest)
    {
        $destStream = $dest instanceof StreamInterface ? $dest : new Stream($dest, Stream::MODE_READ_WRITE_RESET);

        static::copy($src, $destStream);

        $destStream->close();
    }
727439
protected function copyFile($source, $dest)
  {
    $dir  = dirname($dest);

    if (!is_dir($dir)) {
      mkdir($dir, 0777, true);
    }

    if (is_uploaded_file($source)) {
      $res = @move_uploaded_file($source, $dest);
    } else {
      $res = @copy($source, $dest);
    }

    if (!$res) {
      $err = error_get_last();

      Exception::ThrowError(Exception::PROCESSING_FILE, $err['message']);
    }
  }
666730
public function thumbs($dest = '.', $sizes = [[false, 960], [false, 480], [false, 192], [false, 96], [false, 48]], $mask = '_%s', $crop = false, $bigger = false){
		if ( $this->test() && is_dir($dest) ){
      $this->get_extension();
			$w = $this->get_width();
			$h = $this->get_height();
			$d = $w >= $h ? 'w' : 'h';
      $res = [];
      if ( bbn\str::is_integer($sizes) ){
        $sizes = [[$sizes, false]];
      }
			if ( $$d / ($d === 'w' ? $h : $w) < 5 ){
				$mask = ($dest === '.' ? '' : $dest.'/').$this->title.$mask.'.'.$this->ext;
        //die(var_dump($mask));
				foreach ( $sizes as $s ){
          if ( bbn\str::is_integer($s) ){
            $s = [$s, false];
          }
          if (
            (!empty($s[0]) && ($w > $s[0])) ||
            (!empty($s[1]) && ($h > $s[1])) ||
            $bigger
          ){
            $smask = (empty($s[0]) ? '' : 'w'.$s[0]).(empty($s[1]) ? '' : 'h'.$s[1]);
            $fn = sprintf($mask, $smask);
            if ( $s[0] && $s[1] ){
              if ( $crop ){
                $this->resize($s[0], $s[1], true);
              }
              else{
                $this->resize($d === 'w' ? $s[0] : false, $d === 'h' ? $s[1] : false, false, $s[0], $s[1]);
              }
            }
            else{
              $this->resize($s[0], $s[1], $crop);
            }
            $this->save($fn);
            $res[$smask] = $fn;
          }
				}
				return $res;
			}
		}
    return false;
	}
304640
public static function rcopy($src, $dest)
    {

        // If the src is not a directory do a simple file copy
        if (!is_dir($src)) {
            copy($src, $dest);
            return true;
        }

        // If the destination directory does not exist create it
        if (!is_dir($dest)) {
            static::create($dest);
        }

        // Open the source directory to read in files
        $i = new \DirectoryIterator($src);
        /** @var \DirectoryIterator $f */
        foreach ($i as $f) {
            if ($f->isFile()) {
                copy($f->getRealPath(), "{$dest}/" . $f->getFilename());
            } else {
                if (!$f->isDot() && $f->isDir()) {
                    static::rcopy($f->getRealPath(), "{$dest}/{$f}");
                }
            }
        }
        return true;
    }
60304
public function copy($src, $dest)
    {
        if (is_dir($src)) {
            $this->ensureDir($dest);
            $files = scandir($src);
            foreach ($files as $file) {
                if ($file !== '.' && $file !== '..') {
                    $this->copy($src . '/' . $file, $dest . '/' . $file);
                }
            }
        } else {
            $this->ensureDir(dirname($dest));

            copy($src, $dest);
        }
    }
200649
protected function copyTemplate($template, $dest)
    {
        $source = __DIR__.'/../../templates/'.$template;
        if (file_exists($source)) {
            return file_put_contents($dest, file_get_contents($source));
        }
    }
1181408
public function setDelCost($delCost)
    {
        $this->calculated = $delCost == $this->delCost ? $this->calculated : false;
        $this->delCost = $delCost;
    }
1176751
public function setExif(string $exif) {
        if($this->setModified('exif', $exif)->isModified()) {
            $this->exif = $exif;
        }

        return $this;
    }
962245
public static URI setPath(final URI orig, final String path) {
        try {
            return new URI(orig.getScheme(), orig.getUserInfo(), orig.getHost(), orig.getPort(), path, orig.getQuery(), orig.getFragment());
        } catch (final URISyntaxException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
489492
function setOriginalAttributeData( $originalData )
    {
        $this->ContentObjectAttributeData['DataTypeCustom']['original_data'] = $originalData;

        $domTree = $this->domTree();
        $imageOriginalArray = $domTree->getElementsByTagName( "original" );
        if ( $imageOriginalArray->length > 0 )
        {
            $imageOriginalNode = $imageOriginalArray->item( 0 );
            $this->createOriginalAttributeXMLData( $imageOriginalNode, $originalData );
        }
    }
937569
public function MoveFolder($source,$dest){
        $this->CopyFiles($source,$dest);
        $this->RemoveFiles($source);
    }
623667
protected function copyFileWithDirsCreating($src, $dest)
    {
        $dirPathOfDestFile = dirname($dest);

        if (! File::exists($dirPathOfDestFile)) {
            File::makeDirectory($dirPathOfDestFile, 0755, true);
        }

        if (! File::exists($dest)) {
            File::copy($src, $dest);
        }
    }
391423
function orig() {
    	$lines = array();

    	foreach ($this->edits as $edit) {
    		if ($edit->orig)
    			array_splice($lines, sizeof($lines), 0, $edit->orig);
    	}
    	return $lines;
    }
392045
public function copy($source, $dest)
    {
        // Simple copy for a file
        if (is_file($source)) {
            if (file_exists($dest) && (!empty($this->options['overwrite']) || fileatime($source) < fileatime($dest))) {
                return true;
            }

            return copy($source, $dest);
        }

        // Make destination directory
        if (!is_dir($dest)) {
            @mkdir($dest, 0777, true);
        }

        // Loop through the folder
        $dir = dir($source);
        while (false !== $entry = $dir->read()) {
            // Skip pointers
            if ($entry == '.' || $entry == '..') {
                continue;
            }

            // Deep copy directories
            if ($dest !== "$source/$entry") {
                $this->copy("$source/$entry", "$dest/$entry");
            }
        }

        // Clean up
        $dir->close();

        return true;
    }
1021224
public function get($src, $dest){
		if ( $src = $this->checkFilePath($src) &&
            ftp_get($this->cn, $dest, $src, FTP_BINARY) ){
      return true;
		}
		return false;
	}
193617
protected function move($src, $dest, &$errors = 0, &$success = 0)
    {
        $this->copy($src, $dest, $errors, $success);

        if (empty($errors)) {
            gplcart_file_delete_recursive($src, $errors);
        }

        return empty($errors);
    }