Check that the file is above the minimum height requirement

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

        return $height > 0 && $imgHeight >= $height;
    }
1030426
public function runResize(Image $image, $fit, $width, $height)
    {
        if ($fit === 'contain') {
            return $this->runContainResize($image, $width, $height);
        }

        if ($fit === 'fill') {
            return $this->runFillResize($image, $width, $height);
        }

        if ($fit === 'max') {
            return $this->runMaxResize($image, $width, $height);
        }

        if ($fit === 'stretch') {
            return $this->runStretchResize($image, $width, $height);
        }

        if ($fit === 'crop') {
            return $this->runCropResize($image, $width, $height);
        }

        return $image;
    }
492888
public function getMetaImageResizeHeight($height = null)
    {
        if ($height) {
            return $height;
        }
        
        if ($height = $this->owner->ImageMetaResizeHeight) {
            return $height;
        }
        
        return $this->owner->getFieldFromParent('DefaultImageResizeHeight');
    }
188044
protected function validateImage (UploadedFile $handle)
    {
        $configs = $this->getConfigs();
        $maxSize = $configs['max_upload_size'];
        $extensions = $configs['extensions'];
        $imageConstraint = new Image();
        $imageConstraint->minWidth = $configs['minWidth'];
        $imageConstraint->minHeight = $configs['minHeight'];
        $imageConstraint->maxSize = $maxSize;
        $imageConstraint->mimeTypes =
            array_map(function($item){return 'image/' . $item;}, explode( ',',  $extensions));
        $errors = $this->container->get('validator')->validateValue($handle, $imageConstraint);

        if (count($errors) == 0) {
            return true;
        } else {
            return $this->container->get('translator')
                ->trans(/** @Ignore */$errors[0]->getMessageTemplate(), $errors[0]->getMessageParameters());
        }
    }
767430
protected function checkFileSize($filename) {

        if ( filesize($filename) > $this->config['max_size'] ) {
            $this->errNum = 1;
        }

        //如果是图片还要检查图片的宽度和高度是否超标
        $size = getimagesize($filename);
        if ( $size != false ) {

            $this->fileInfo['is_image'] = 1;
            if ( ($this->config['max_width'] > 0 && $size[0] > $this->config['max_width'])
                || ($this->config['max_height'] > 0 && $size[1] > $this->config['max_height']) )  {
                $this->errNum = 9;
            }
            $this->fileInfo['image_width'] = $size[0];
            $this->fileInfo['image_height'] = $size[1];

        } else {

            $this->fileInfo['is_image'] = 0;

        }

	}
972773
public function checkIntegrity($check)
  {
    $db=$this->getDbConnection();
    foreach($this->schemas as $schema){
      $db->createCommand()->checkIntegrity($check,$schema)->execute();
    }
  }
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;
    }
23633
protected function validate(UploadFile $file)
    {
        if (parent::validate($file)) {

            $info = getimagesize($file->getFileTemp());
            $width = $info[ 0 ];
            $height = $info[ 1 ];

            /* Validate width min size */
            if ($this->allowedImageSize[ 'width' ][ 'min' ] > 0) {
                if ($width < $this->allowedImageSize[ 'width' ][ 'min' ]) {
                    $this->errors[] = language()->getLine(
                        'IMAGE_E_ALLOWED_MIN_WIDTH_SIZE',
                        [$this->allowedFileSize[ 'min' ], $width]
                    );
                }
            }

            /* Validate width max size */
            if ($this->allowedImageSize[ 'width' ][ 'max' ] > 0) {
                if ($width > $this->allowedImageSize[ 'width' ][ 'max' ]) {
                    $this->errors[] = language()->getLine(
                        'IMAGE_E_ALLOWED_MAX_WIDTH_SIZE',
                        [$this->allowedFileSize[ 'max' ], $width]
                    );
                }
            }

            /* Validate height min size */
            if ($this->allowedImageSize[ 'height' ][ 'min' ] > 0) {
                if ($height < $this->allowedImageSize[ 'width' ][ 'min' ]) {
                    $this->errors[] = language()->getLine(
                        'IMAGE_E_ALLOWED_MIN_HEIGHT_SIZE',
                        [$this->allowedFileSize[ 'min' ], $height]
                    );
                }
            }

            /* Validate height max size */
            if ($this->allowedImageSize[ 'height' ][ 'max' ] > 0) {
                if ($height > $this->allowedImageSize[ 'width' ][ 'max' ]) {
                    $this->errors[] = language()->getLine(
                        'IMAGE_E_ALLOWED_MAX_HEIGHT_SIZE',
                        [$this->allowedFileSize[ 'max' ], $height]
                    );
                }
            }
        }

        if (count($this->errors) == 0) {
            return true;
        }

        return false;
    }
430369
protected function validate(UploadFile $file)
    {
        /* Validate extension */
        if (is_array($this->allowedExtensions) && count($this->allowedExtensions)) {
            if ( ! in_array('.' . $file->getExtension(), $this->allowedExtensions)) {
                $this->errors[] = language()->getLine(
                    'UPLOADER_E_ALLOWED_EXTENSIONS',
                    [implode(',', $this->allowedExtensions), $file->getExtension()]
                );
            }
        }

        /* Validate mime */
        if (is_array($this->allowedMimes) && count($this->allowedExtensions)) {
            if ( ! in_array($file->getFileMime(), $this->allowedMimes)) {
                $this->errors[] = language()->getLine(
                    'UPLOADER_E_ALLOWED_MIMES',
                    [implode(',', $this->allowedMimes), $file->getFileMime()]
                );
            }
        }

        /* Validate min size */
        if ($this->allowedFileSize[ 'min' ] > 0) {
            if ($file->getSize() < $this->allowedFileSize[ 'min' ]) {
                $this->errors[] = language()->getLine(
                    'UPLOADER_E_ALLOWED_MIN_FILESIZE',
                    [$this->allowedFileSize[ 'min' ], $file->getSize()]
                );
            }
        }

        /* Validate max size */
        if ($this->allowedFileSize[ 'min' ] > 0) {
            if ($file->getSize() > $this->allowedFileSize[ 'max' ]) {
                $this->errors[] = language()->getLine(
                    'UPLOADER_E_ALLOWED_MAX_FILESIZE',
                    [$this->allowedFileSize[ 'max' ], $file->getSize()]
                );
            }
        }

        if (count($this->errors) == 0) {
            return true;
        }

        return false;
    }
1319394
public function validateIsbn($check)
    {
        $ean = strval($check);
        $code = substr($ean, 0, -1);
        $key = $this->calculateCheckdigit13($code);
        
        // in key steht die prüfziffer - an den code anhängen
        $code .= $key;
        if ($code == $ean)
        {
            return true;
        }else
        {
            return false;
        }
    }
1366934
public function runMaxResize(Image $image, $width, $height)
    {
        return $image->resize($width, $height, function ($constraint) {
            $constraint->aspectRatio();
            $constraint->upsize();
        });
    }
884922
public function setHeight($height)
    {
        if (!is_numeric($height)) {
            throw new \LogicException('Box height is NaN!');
        }

        $this->height = (int) $height;

        return $this;
    }
1033707
public function filterMaxHeight($height)
    {
        return $this->filter(
            function ($key, $value) use ($height) {
                if ($value instanceof ImageFilter &&
                    $value->getHeight() <= $height && $value->getHeight() !== null
                ) {
                    return true;
                }
            }
        );
    }
395831
protected function checkLevel($level) 
    {        
        switch ($this->logLevel) {
            case self::LEVEL_EMERGENCY:
                if ($level != 'emergency') {
                    return false;
                }
                break;
                
            case self::LEVEL_ALTER:
                if (false === stripos('emergency|alert', $level)) {
                    return false;
                }
                break;

            case self::LEVEL_CRITICAL:
                if (false === stripos('emergency|alert|critical', $level)) {
                    return false;
                }
                break;

            case self::LEVEL_ERROR:
                if (false === stripos('emergency|alert|critical|error', $level)) {
                    return false;
                }
                break;

            case self::LEVEL_WARNING:
                if (false === stripos('emergency|alert|critical|error|warning', $level)) {
                    return false;
                }
                break;

            case self::LEVEL_NOTICE:
                if (false === stripos('emergency|alert|critical|error|notice', $level)) {
                    return false;
                }
                break;

            case self::LEVEL_INFO:
                if (false === stripos('emergency|alert|critical|error|notice|info', $level)) {
                    return false;
                }
                break;
            case self::LEVEL_DEBUG:
                // logging all
                break;
        }
        
        return true;
    }
1133685
protected function validateMinHeight($height, Constraint $constraint)
    {
        if ($constraint->minHeight) {
            if (!ctype_digit((string) $constraint->minHeight)) {
                throw new ConstraintDefinitionException(
                    sprintf(
                        '"%s" is not a valid minimum height',
                        $constraint->minHeight
                    )
                );
            }

            if ($height < $constraint->minHeight) {
                $this->context->addViolation(
                    $constraint->minHeightMessage,
                    array(
                        '{{ height }}' => $height,
                        '{{ min_height }}' => $constraint->minHeight
                    )
                );

                return true;
            }
        }

    }
324036
public function delete($condition, $check = true)
    {
        $result = null;
        $this->hook->attach('file.delete.before', $condition, $check, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if (!is_array($condition)) {
            $condition = array('file_id' => $condition);
        }

        if ($check && isset($condition['file_id']) && !$this->canDelete($condition['file_id'])) {
            return false;
        }

        $result = (bool) $this->db->delete('file', $condition);

        if ($result && isset($condition['file_id'])) {
            $this->deleteLinked($condition['file_id']);
        }

        $this->hook->attach('file.delete.after', $condition, $check, $result, $this);
        return (bool) $result;
    }
321088
private function resizeHeight($height, Closure $callback = null)
    {
        $constraint = $this->getConstraint($callback);

        if ($constraint->isFixed(Constraint::UPSIZE)) {
            $max_width = $constraint->getSize()->getWidth();
            $max_height = $constraint->getSize()->getHeight();
        }

        if (is_numeric($height)) {

            if ($constraint->isFixed(Constraint::UPSIZE)) {
                $this->height = ($height > $max_height) ? $max_height : $height;
            } else {
                $this->height = $height;
            }

            if ($constraint->isFixed(Constraint::ASPECTRATIO)) {
                $w = (int) round($this->height * $constraint->getSize()->getRatio());

                if ($constraint->isFixed(Constraint::UPSIZE)) {
                    $this->width = ($w > $max_width) ? $max_width : $w;
                } else {
                    $this->width = $w;
                }
            }
        }

        return $this;
    }