本文整理汇总了PHP中Pel::getJPEGQuality方法的典型用法代码示例。如果您正苦于以下问题:PHP Pel::getJPEGQuality方法的具体用法?PHP Pel::getJPEGQuality怎么用?PHP Pel::getJPEGQuality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pel
的用法示例。
在下文中一共展示了Pel::getJPEGQuality方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct a new data window with the data supplied.
*
* @param
* mixed the data that this window will contain. This can
* either be given as a string (interpreted litteraly as a sequence
* of bytes) or a PHP image resource handle. The data will be copied
* into the new data window.
*
* @param
* boolean the initial byte order of the window. This must
* be either {@link PelConvert::LITTLE_ENDIAN} or {@link
* PelConvert::BIG_ENDIAN}. This will be used when integers are
* read from the data, and it can be changed later with {@link
* setByteOrder()}.
*/
public function __construct($data = '', $endianess = PelConvert::LITTLE_ENDIAN)
{
if (is_string($data)) {
$this->data = $data;
} elseif (is_resource($data) && get_resource_type($data) == 'gd') {
/*
* The ImageJpeg() function insists on printing the bytes
* instead of returning them in a more civil way as a string, so
* we have to buffer the output...
*/
ob_start();
ImageJpeg($data, null, Pel::getJPEGQuality());
$this->data = ob_get_clean();
} else {
throw new PelInvalidArgumentException('Bad type for $data: %s', gettype($data));
}
$this->order = $endianess;
$this->size = strlen($this->data);
}