mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 20:13:28 +00:00
check if tech_datas has Width & Height key
This commit is contained in:
@@ -93,8 +93,14 @@ class binaryAdapter_image_resize_gd extends binaryAdapter_processorAbstract
|
|||||||
|
|
||||||
$size = $this->options['size'];
|
$size = $this->options['size'];
|
||||||
|
|
||||||
if (!is_null($size) && !$origine->is_raw_image()
|
if (
|
||||||
&& $tech_datas[system_file::TC_DATAS_WIDTH] < $size && $tech_datas[system_file::TC_DATAS_HEIGHT] < $size)
|
!is_null($size)
|
||||||
|
&& isset($tech_datas[system_file::TC_DATAS_WIDTH])
|
||||||
|
&& isset($tech_datas[system_file::TC_DATAS_HEIGHT])
|
||||||
|
&& !$origine->is_raw_image()
|
||||||
|
&& $tech_datas[system_file::TC_DATAS_WIDTH] < $size
|
||||||
|
&& $tech_datas[system_file::TC_DATAS_HEIGHT] < $size
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$size = max($tech_datas[system_file::TC_DATAS_WIDTH], $tech_datas[system_file::TC_DATAS_HEIGHT]);
|
$size = max($tech_datas[system_file::TC_DATAS_WIDTH], $tech_datas[system_file::TC_DATAS_HEIGHT]);
|
||||||
}
|
}
|
||||||
@@ -134,8 +140,7 @@ class binaryAdapter_image_resize_gd extends binaryAdapter_processorAbstract
|
|||||||
$w_sub = (int) (($w_doc / $h_doc) * ($h_sub = $size));
|
$w_sub = (int) (($w_doc / $h_doc) * ($h_sub = $size));
|
||||||
$img_mini = imagecreatetruecolor($w_sub, $h_sub);
|
$img_mini = imagecreatetruecolor($w_sub, $h_sub);
|
||||||
|
|
||||||
imagecopyresampled($img_mini, $imag_original, 0, 0, 0, 0,
|
imagecopyresampled($img_mini, $imag_original, 0, 0, 0, 0, $w_sub, $h_sub, $w_doc, $h_doc);
|
||||||
$w_sub, $h_sub, $w_doc, $h_doc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->options['autorotate'])
|
if ($this->options['autorotate'])
|
||||||
|
Reference in New Issue
Block a user