Skip to content

Commit

Permalink
Update to 7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Oct 9, 2023
1 parent 5d25d36 commit dda1a1e
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 51 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
basedir=".">

<property name="VERSION"
value="7.6" />
value="7.7" />

<tstamp>
<format property="DATE"
Expand Down
89 changes: 47 additions & 42 deletions packages/mod_junewsultra/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function image($params, $junews, array $data = [])
$attr[] = 'decoding="async"';
}

if(isset($data[ 'src' ]))
if(isset($data[ 'src' ]) && $data[ 'src' ] !== '')
{
$src = $data[ 'src' ];
if($junews[ 'thumb_width' ] == 1)
Expand Down Expand Up @@ -265,58 +265,63 @@ public function image($params, $junews, array $data = [])
*/
public function thumb($image, array $junews = [])
{
$aspect = 0;
if($junews[ 'auto_zoomcrop' ] == 1)
if($image)
{
$aspect = $this->aspect($image, $junews[ 'cropaspect' ]);
}

$newimgparams = [
'zc' => $junews[ 'zoomcrop' ] == 1 ? $junews[ 'zoomcrop_params' ] : ''
];
if($aspect >= 1 && $junews[ 'auto_zoomcrop' ] == 1)
{
$newimgparams = [
'far' => '1',
'bg' => $junews[ 'zoomcropbg' ]
];
}
$aspect = 0;
if($junews[ 'auto_zoomcrop' ] == 1)
{
$aspect = $this->aspect($image, $junews[ 'cropaspect' ]);
}

if($junews[ 'farcrop' ] == 1)
{
$newimgparams = [
'far' => $junews[ 'farcrop_params' ],
'bg' => $junews[ 'farcropbg' ]
'zc' => $junews[ 'zoomcrop' ] == 1 ? $junews[ 'zoomcrop_params' ] : ''
];
}
if($aspect >= 1 && $junews[ 'auto_zoomcrop' ] == 1)
{
$newimgparams = [
'far' => '1',
'bg' => $junews[ 'zoomcropbg' ]
];
}

$imgparams = [
'w' => $junews[ 'w' ],
'h' => $junews[ 'h' ],
'sx' => $junews[ 'sx' ] ? : '',
'sy' => $junews[ 'sy' ] ? : '',
'sw' => $junews[ 'sw' ] ? : '',
'sh' => $junews[ 'sh' ] ? : '',
'f' => $junews[ 'f' ],
'q' => $junews[ 'q' ],
'cache' => $junews[ 'image_thumb' ]
];
if($junews[ 'farcrop' ] == 1)
{
$newimgparams = [
'far' => $junews[ 'farcrop_params' ],
'bg' => $junews[ 'farcropbg' ]
];
}

$webp = [];
$webp_im = [];
if($junews[ 'usewebp' ] == 1)
{
$webp = [ 'webp' => true ];
$imgparams = [
'w' => $junews[ 'w' ],
'h' => $junews[ 'h' ],
'sx' => $junews[ 'sx' ] ? : '',
'sy' => $junews[ 'sy' ] ? : '',
'sw' => $junews[ 'sw' ] ? : '',
'sh' => $junews[ 'sh' ] ? : '',
'f' => $junews[ 'f' ],
'q' => $junews[ 'q' ],
'cache' => $junews[ 'image_thumb' ]
];

if($junews[ 'usegd2webp' ] == 1)
$webp = [];
$webp_im = [];
if($junews[ 'usewebp' ] == 1)
{
$webp_im = [ 'imagemagick' => false ];
$webp = [ 'webp' => true ];

if($junews[ 'usegd2webp' ] == 1)
{
$webp_im = [ 'imagemagick' => false ];
}
}
}

$imgparams_merge = array_merge($imgparams, $newimgparams, $webp, $webp_im);
$imgparams_merge = array_merge($imgparams, $newimgparams, $webp, $webp_im);

return $this->juimg->render($image, $imgparams_merge);
}

return $this->juimg->render($image, $imgparams_merge);
return '';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/mod_junewsultra/helper/com_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ public function getList($params, $junews)
switch($junews[ 'thumb_width' ])
{
case '0':
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand All @@ -713,7 +713,7 @@ public function getList($params, $junews)

case '1':
default:
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand Down
4 changes: 2 additions & 2 deletions packages/mod_junewsultra/helper/com_k2.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public function getList($params, $junews)
switch($junews[ 'thumb_width' ])
{
case '0':
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand All @@ -581,7 +581,7 @@ public function getList($params, $junews)

case '1':
default:
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand Down
4 changes: 2 additions & 2 deletions packages/mod_junewsultra/helper/rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getList($params, $junews)
switch($junews[ 'thumb_width' ])
{
case '0':
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand All @@ -173,7 +173,7 @@ public function getList($params, $junews)

case '1':
default:
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand Down
4 changes: 2 additions & 2 deletions packages/mod_junewsultra/helper/youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getList($params, $junews)
switch($junews[ 'thumb_width' ])
{
case '0':
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand All @@ -177,7 +177,7 @@ public function getList($params, $junews)

case '1':
default:
if($blank == 1)
if($blank == 1 && $junuimgsource)
{
$item->image = $this->image($params, $junews, [
'src' => $junuimgsource,
Expand Down

0 comments on commit dda1a1e

Please sign in to comment.