@@ -319,19 +319,17 @@ public function getImages()
319
319
public function getImage ()
320
320
{
321
321
if ($ this ->config ['getBiggerImage ' ]) {
322
- if (($ src = Utils::getBiggerValue ($ this ->images , true )) !== null ) {
323
- $ image = $ this ->images [$ src ];
322
+ $ images = $ this ->images ;
324
323
325
- if (($ image ['width ' ] >= $ this ->config ['minImageWidth ' ]) && ($ image ['height ' ] >= $ this ->config ['minImageHeight ' ])) {
326
- return $ src ;
327
- }
324
+ if ($ images ) {
325
+ $ images = [$ images ];
328
326
}
329
-
330
- return ;
327
+ } else {
328
+ $ images = Utils:: sortByProviders ( $ this -> images ) ;
331
329
}
332
330
333
- foreach (Utils:: sortByProviders ( $ this -> images ) as $ images ) {
334
- if (($ key = Utils::getBiggerValue ($ images , true )) !== null ) {
331
+ foreach ($ images as $ image ) {
332
+ if (($ key = Utils::getBiggerValue ($ image , true )) !== null ) {
335
333
$ image = $ this ->images [$ key ];
336
334
337
335
if (($ image ['width ' ] >= $ this ->config ['minImageWidth ' ]) && ($ image ['height ' ] >= $ this ->config ['minImageHeight ' ])) {
@@ -382,11 +380,8 @@ public function getHeight()
382
380
*/
383
381
public function getAspectRatio ()
384
382
{
385
- $ width = $ this ->width ;
386
- $ height = $ this ->height ;
387
-
388
- if ($ width && (strpos ($ width , '% ' ) === false ) && $ height && (strpos ($ height , '% ' ) === false )) {
389
- return round (($ height / $ width ) * 100 , 3 );
383
+ if (!empty ($ this ->width ) && (strpos ($ this ->width , '% ' ) === false ) && !empty ($ this ->height ) && (strpos ($ this ->height , '% ' ) === false )) {
384
+ return round (($ this ->height / $ this ->width ) * 100 , 3 );
390
385
}
391
386
}
392
387
0 commit comments