Set size info

@param int $dimensionType Type of dimension. Either width or height
@param int $fieldLength Length of field. Either short or long
@param string $ifdValue String value of IFD field
963305
protected function setSizeInfo($dimensionType, $fieldLength, $ifdValue)
	{
		// Set size of field
		$fieldSize = $fieldLength === self::TIF_TAG_TYPE_SHORT ? $this->typeShort : $this->typeLong;

		// Get actual dimensions from IFD
		if ($dimensionType === self::TIF_TAG_IMAGE_HEIGHT)
		{
			$this->size = array_merge($this->size, unpack($fieldSize . 'height', $ifdValue));
		}
		else if ($dimensionType === self::TIF_TAG_IMAGE_WIDTH)
		{
			$this->size = array_merge($this->size, unpack($fieldSize . 'width', $ifdValue));
		}
	}
922422
public function getColumnPaddingLength($columnIndex, $columnValue)
    {
        if ($this->columns->offsetExists($columnIndex) === false) {
            return 0;
        }

        return $this->columns->offsetGet($columnIndex) - strlen($columnValue);
    }
613973
private void ensureLength(FieldDescriptorDef fieldDef, String checkLevel)
    {
        if (!fieldDef.hasProperty(PropertyHelper.OJB_PROPERTY_LENGTH))
        {
            String defaultLength = JdbcTypeHelper.getDefaultLengthFor(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));

            if (defaultLength != null)
            {
                LogHelper.warn(true,
                               FieldDescriptorConstraints.class,
                               "ensureLength",
                               "The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has no length setting though its jdbc type requires it (in most databases); using default length of "+defaultLength);
                fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_LENGTH, defaultLength);
            }
        }
    }
795204
public function setDecimalValue($decimalValue)
    {
        if (\is_array($decimalValue) || \is_object($decimalValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting float, got '.gettype($decimalValue);
            throw new \UnexpectedValueException($m);
        }
        $this->decimalValue = null === $decimalValue ? null : (float) $decimalValue;

        return $this;
    }
1057561
static public function maxLength($value, $maxLength, $message = null, $propertyPath = null, $encoding = 'utf8')
        {
            static::string($value, $message);

            if (mb_strlen($value, $encoding) > $maxLength) {
                $message = $message ?: sprintf(
                    'Value "%s" is too long, it should have no more than %d characters, but has %d characters.',
                    static::stringify($value),
                    $maxLength,
                    mb_strlen($value, $encoding)
                );

                $constraints = array('max_length' => $maxLength, 'encoding' => $encoding);

                throw static::createException($value, $message, static::INVALID_MAX_LENGTH, $propertyPath, $constraints);
            }
        }
217058
public static function deriveFieldLength(array $dataTypeInfo): ?int
  {
    switch ($dataTypeInfo['data_type'])
    {
      case 'tinyint':
      case 'smallint':
      case 'mediumint':
      case 'int':
      case 'bigint':
      case 'float':
      case 'double':
        $ret = $dataTypeInfo['numeric_precision'];
        break;

      case 'decimal':
        $ret = $dataTypeInfo['numeric_precision'];
        if ($dataTypeInfo['numeric_scale']>0) $ret += 1;
        break;

      case 'char':
      case 'varchar':
      case 'binary':
      case 'varbinary':
      case 'tinytext':
      case 'text':
      case 'mediumtext':
      case 'longtext':
      case 'tinyblob':
      case 'blob':
      case 'mediumblob':
      case 'longblob':
      case 'bit':
        $ret = $dataTypeInfo['character_maximum_length'];
        break;

      case 'timestamp':
        $ret = 16;
        break;

      case 'year':
        $ret = 4;
        break;

      case 'time':
        $ret = 8;
        break;

      case 'date':
        $ret = 10;
        break;

      case 'datetime':
        $ret = 16;
        break;

      case 'enum':
      case 'set':
        // We don't assign a width to column with type enum and set.
        $ret = null;
        break;

      default:
        throw new FallenException('data type', $dataTypeInfo['data_type']);
    }

    return $ret;
  }
923395
public function setCodeLengths($aCodeLengths)
    {
        if ($this->isValidCodeLengths($aCodeLengths)) {
            $this->_aCodeLengths = $aCodeLengths;

            return true;
        } else {
            return false;
        }
    }
1319486
public function setStringValue($stringValue)
    {
        if (\is_array($stringValue) || \is_object($stringValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting string, got '.gettype($stringValue);
            throw new \UnexpectedValueException($m);
        }
        if (null !== $stringValue && 255 < \mb_strlen($stringValue)) {
            $stringValue = mb_substr($stringValue, 0, 255);
        }
        $this->stringValue = null === $stringValue ? null : (string) $stringValue;

        return $this;
    }
1112273
private void setLength(double length) {
        switch (type) {
            case BOX:
                box.setHeight(length);
                break;
            case CYLINDER:
                cylinder.setHeight(length);
                break;
            default:
                break;
        }
    }
376716
public void setValue(int size, float[] newValue) {
        if ( ((newValue.length%2) == 0) && ((newValue.length/2) == size)) {
            try {
                for (int i = 0; i < size; i++) {
                    value.set(i, new SFVec2f(newValue[i*3], newValue[i*3+1]));
                }
            }
            catch (IndexOutOfBoundsException e) {
                Log.e(TAG, "X3D MFVec2f setValue(size,newValue[]) out of bounds." + e);
            }
            catch (Exception e) {
                Log.e(TAG, "X3D MFVec2f setValue(size, newValue[]) exception " + e);
            }
        }
        else {
            Log.e(TAG, "X3D MFVec2f setValue() set with newValue[] length not multiple of 2, or equal to size parameter");
        }
    }
182178
public function isEmptyValue(FieldValue $fieldValue)
    {
        return $this->internalFieldType->isEmptyValue(
            $this->internalFieldType->fromPersistenceValue($fieldValue)
        );
    }
500522
public void setLength(long size) throws IOException, RepositoryException
   {
      if (!changed)
      {
         internalData = createEditableCopy(this.getInternalData());
      }

      ((EditableValueData)internalData).setLength(size);
      invalidateStream();
   }
70228
public function scaleDownToLimit( $width, $height, $interpolate = TRUE )
	{
		if( !is_int( $width ) )
			throw new InvalidArgumentException( 'Width must be integer' );
		if( !is_int( $height ) )
			throw new InvalidArgumentException( 'Height must be integer' );
		$sourceWidth	= $this->image->getWidth();
		$sourceHeight	= $this->image->getHeight();
		if( $sourceWidth <= $width && $sourceHeight <= $height )
			return FALSE;
		$scale = 1;
		if( $sourceWidth > $width )
			$scale	*= $width / $sourceWidth;
		if( $sourceHeight * $scale > $height )
			$scale	*= $height / ( $sourceHeight * $scale );
		$width	= (int) round( $sourceWidth * $scale );
		$height	= (int) round( $sourceHeight * $scale );
		return $this->resize( $width, $height, $interpolate );
	}
422290
public function validateMaxUploadFileSize($varValue, DataContainer $dc)
	{
		$arrValue = deserialize($varValue);
		$dmsUnit = $arrValue['unit'];
		$dmsVal = \Document::convertFileSize((double) $arrValue['value'], $dmsUnit, \Document::FILE_SIZE_UNIT_BYTE);
		$phpVal = $this->getPhpUploadMaxFilesize();
		
		if ($dmsVal > $phpVal)
		{
			throw new \Exception(sprintf($GLOBALS['TL_LANG']['ERR']['dmsMaxUploadFileSize'], \Document::formatFileSize(\Document::convertFileSize($phpVal, \Document::FILE_SIZE_UNIT_BYTE, $dmsUnit), $dmsUnit)));
		}
		
		return $varValue;
	}
1328428
protected function _checkCipherKeySize(CipherAlgorithmIdentifier $algo,
        string $key)
    {
        if ($algo instanceof BlockCipherAlgorithmIdentifier) {
            if (strlen($key) != $algo->keySize()) {
                throw new \UnexpectedValueException(
                    sprintf('Key length for %s must be %d, %d given.',
                        $algo->name(), $algo->keySize(), strlen($key)));
            }
        }
    }
447656
public function setMaxvalueHeight($maxvalue_height){
        if(!is_int($maxvalue_height)){
            throw new \Exception("Falscher Dateityp (".gettype($maxvalue_height).") integer expected!");
        }
        $this->maxvalue_height = $maxvalue_height;
        return true;
    }
1251733
function setInitialDimensions(el) {
	    if (el.holderData) {
	        var dimensions = dimensionCheck(el);
	        if (dimensions) {
	            var flags = el.holderData.flags;

	            var fluidConfig = {
	                fluidHeight: flags.dimensions.height.slice(-1) == '%',
	                fluidWidth: flags.dimensions.width.slice(-1) == '%',
	                mode: null,
	                initialDimensions: dimensions
	            };

	            if (fluidConfig.fluidWidth && !fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'width';
	                fluidConfig.ratio = fluidConfig.initialDimensions.width / parseFloat(flags.dimensions.height);
	            } else if (!fluidConfig.fluidWidth && fluidConfig.fluidHeight) {
	                fluidConfig.mode = 'height';
	                fluidConfig.ratio = parseFloat(flags.dimensions.width) / fluidConfig.initialDimensions.height;
	            }

	            el.holderData.fluidConfig = fluidConfig;
	        } else {
	            setInvisible(el);
	        }
	    }
	}