Check that the file is above the minimum width requirement

@param mixed $check Value to check
@param int $width Width of Image
@return bool Success
174668
public static function isAboveMinWidth($check, $width)
    {
        // Non-file uploads also mean the height is too big
        if (!isset($check['tmp_name']) || !strlen($check['tmp_name'])) {
            return false;
        }
        list($imgWidth) = getimagesize($check['tmp_name']);

        return $width > 0 && $imgWidth >= $width;
    }
364317
public function validateFile()
    {
        $totalChunks = $this->request->getTotalChunks();
        $totalChunksSize = 0;

        for ($i = $totalChunks; $i >= 1; $i--) {
            $file = $this->getChunkPath($i);
            if (!file_exists($file)) {
                return false;
            }
            $totalChunksSize += filesize($file);
        }

        return $this->request->getTotalSize() == $totalChunksSize;
    }
1011273
public function getCssIfMatchRoute($check, $css = 'active')
    {
        if (is_string($check)) {
            $matcher = $this->router->match($this->request->getCurrentRequest()->getPathInfo());
            $check = $matcher['_route'] === $check;
        }

        return $check ? $css : null;
    }
637438
public function setWidth($width)
    {
        $this->width = null;
        if ($width && is_numeric($width)) {
            $width = (int) $width;
            if ($width > 0) {
                $this->width = $width;
            }
        }
    }
1120751
protected function validateFileSize()
    {
        if (!is_numeric($this->max_file_size) && !is_int($this->max_file_size)) {
            // it is not set max file size limitation.
            return true;
        }

        if (is_array($this->files[$this->input_file_name]) && array_key_exists('size', $this->files[$this->input_file_name]) && $this->files[$this->input_file_name]['size'] > $this->max_file_size) {
            $this->setErrorMessage(
                sprintf(static::__('The uploaded file exceeds the max file size directive. (%s &gt; %s).'), $this->files[$this->input_file_name]['size'], $this->max_file_size),
                'RDU_1',
                $this->files[$this->input_file_name]['size'] . ' &gt; ' . $this->max_file_size,
                $this->files[$this->input_file_name]['name'],
                $this->files[$this->input_file_name]['size'],
                $this->files[$this->input_file_name]['type']
            );
            return false;
        } else {
            if (is_array($this->files[$this->input_file_name]) && array_key_exists('tmp_name', $this->files[$this->input_file_name]) && function_exists('filesize')) {
                if (filesize($this->files[$this->input_file_name]['tmp_name']) > $this->max_file_size) {
                    $this->setErrorMessage(
                        sprintf(static::__('The uploaded file exceeds the max file size directive. (%s &gt; %s).'), $this->files[$this->input_file_name]['size'], $this->max_file_size),
                        'RDU_1',
                        $this->files[$this->input_file_name]['size'] . ' &gt; ' . $this->max_file_size,
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['size'],
                        $this->files[$this->input_file_name]['type']
                    );
                    return false;
                }
            }
        }

        return true;
    }
1223373
private function checkValidity()
    {

        if (!is_writable($this->rssFile)) {
            $this->valid = false;
            return;
        }

        $stmt = $this->db->prepare('SELECT CREATED FROM ' . $this->table . ' ORDER BY CREATED DESC LIMIT 1');
        $stmt->execute();
        $res = $stmt->fetchAll();

        if (count($res) == 0) {
            $this->valid = false;
            return;
        }

        $latestInput = strtotime($res[0]->CREATED);

        $rssCreated = filemtime($this->rssFile);

        if ($latestInput > $rssCreated) {
            $this->valid = false;
        } else {
            $this->valid = true;
        }
    }
530394
protected function validateMinWidth($width, Constraint $constraint)
    {
        if ($constraint->minWidth) {
            if (!ctype_digit((string) $constraint->minWidth)) {
                throw new ConstraintDefinitionException(
                    sprintf(
                        '"%s" is not a valid minimum width',
                        $constraint->minWidth
                    )
                );
            }

            if ($width < $constraint->minWidth) {
                $this->context->addViolation(
                    $constraint->minWidthMessage,
                    array(
                        '{{ width }}' => $width,
                        '{{ min_width }}' => $constraint->minWidth
                    )
                );

                return true;
            }
        }
    }
60014
public function clear($check)
    {
        if (!$this->_init) {
            return false;
        }
        $this->_File = null;

        $threshold = $now = false;
        if ($check) {
            $now = time();
            $threshold = $now - $this->_config['duration'];
        }

        $this->_clearDirectory($this->_config['path'], $now, $threshold);

        $directory = new RecursiveDirectoryIterator(
            $this->_config['path'],
            \FilesystemIterator::SKIP_DOTS
        );
        $contents = new RecursiveIteratorIterator(
            $directory,
            RecursiveIteratorIterator::SELF_FIRST
        );
        $cleared = [];
        foreach ($contents as $path) {
            if ($path->isFile()) {
                continue;
            }

            $path = $path->getRealPath() . DIRECTORY_SEPARATOR;
            if (!in_array($path, $cleared)) {
                $this->_clearDirectory($path, $now, $threshold);
                $cleared[] = $path;
            }
        }

        return true;
    }
1191116
public function setWidth($width){
        if(!is_int($width)){
            throw new \Exception("Falscher Dateityp (".gettype($width).") integer expected!");
        }
        $this->width = $width;
        return true;
    }
698478
protected function check($name, $check = '')
    {
        return (Arr::get($this->keyMap, "{$name}.checksum") === $this->generateNewChecksum($check));
    }
449210
protected function getCheckSQLDeclaration(Check $check)
    {
        if (!$this->supportChecks()) {
            throw PlatformException::methodNotSupported(__METHOD__);
        }

        return 'CONSTRAINT '.$check->getName().' CHECK ('.$check->getDefinition().')';
    }
567513
protected function validateAspectRatio($width, $height)
    {
        /**
         * Allow aspect ratio given?
         */
        if ($this->allowAspectRatioX && $this->allowAspectRatioY) {
            $gcd = $this->gcd($width, $height);
            $x = $width / $gcd;
            $y = $height / $gcd;

            if ($x != $this->allowAspectRatioX || $y != $this->allowAspectRatioY) {
                $this->setErrorMessage(sprintf(
                    $this->messages['aspect_ratio'],
                    $x . ':' . $y,
                    $this->allowAspectRatioX . ':' . $this->allowAspectRatioY
                ));
                return false;
            }
        }

        /**
         * Deny aspect ratio given?
         */
        if ($this->denyAspectRatioX && $this->denyAspectRatioY) {
            $gcd = $this->gcd($width, $height);
            $x = $width / $gcd;
            $y = $height / $gcd;

            if ($x == $this->denyAspectRatioX && $y == $this->denyAspectRatioY) {
                $this->setErrorMessage(sprintf(
                    $this->messages['aspect_ratio_denied'],
                    $x . ':' . $y
                ));
                return false;
            }
        }

        return true;
    }
1320124
protected function validate($file)
    {
        // Check if file is valid
        if ( ! $file->isValid()) {
            return false;
        }

        $inputFile = [$this->field => $file];
        $rules     = [$this->field => $this->validationRules];

        // Validate
        $validator = Validator::make($inputFile, $rules);
        if ($validator->fails()) {
            $this->errors = $validator;

            return false;
        }

        return true;
    }
725213
public function checkIntegrity($check=true,$schema='')
	{
		$enable=$check ? 'ENABLE' : 'DISABLE';
		$tableNames=$this->getTableNames($schema);
		$db=$this->getDbConnection();
		foreach($tableNames as $tableName)
		{
			$tableName='"'.$tableName.'"';
			if(strpos($tableName,'.')!==false)
				$tableName=str_replace('.','"."',$tableName);
			$db->createCommand("ALTER TABLE $tableName $enable TRIGGER ALL")->execute();
		}
	}
1252978
public function setImageWidth( $width )
    {
        $this->imageWidth = empty( $width ) ? null : (int) $width;
        return $this;
    }
1333869
public function check()
    {
        $cutoffTime =  strtotime($this->relativeAge, DBDatetime::now()->Format('U'));
        $files = $this->getFiles();
        $invalidFiles = [];
        $validFiles = [];
        $checkFn = $this->checkFn;
        $allValid = true;
        if ($files) {
            foreach ($files as $file) {
                $fileTime = $checkFn($file);
                $valid = ($this->compareOperand == '>') ? ($fileTime >= $cutoffTime) : ($fileTime <= $cutoffTime);
                if ($valid) {
                    $validFiles[] = $file;
                } else {
                    $invalidFiles[] = $file;
                    if ($this->checkType == self::CHECK_ALL) {
                        return [
                            EnvironmentCheck::ERROR,
                            sprintf(
                                'File "%s" doesn\'t match age check (compare %s: %s, actual: %s)',
                                $file,
                                $this->compareOperand,
                                date('c', $cutoffTime),
                                date('c', $fileTime)
                            )
                        ];
                    }
                }
            }
        }

        // If at least one file was valid, count as passed
        if ($this->checkType == self::CHECK_SINGLE && count($invalidFiles) < count($files)) {
            return [EnvironmentCheck::OK, ''];
        }
        if (count($invalidFiles) == 0) {
            return [EnvironmentCheck::OK, ''];
        }
        return [
            EnvironmentCheck::ERROR,
            sprintf('No files matched criteria (%s %s)', $this->compareOperand, date('c', $cutoffTime))
        ];
    }
1236976
public function validateEnum(Model $model, $check, $rule) {
        $field = key($check);
        $value = $check[$field];

        if ($value === '' || $value === null || $value === false) {
            return (bool) $rule['allowEmpty'];
        }

        $enum = $this->enum($model, $field);

        return isset($enum[$value]);
    }