@@ -319,19 +319,17 @@ public function getImages()
319319 public function getImage ()
320320 {
321321 if ($ this ->config ['getBiggerImage ' ]) {
322- if (($ src = Utils::getBiggerValue ($ this ->images , true )) !== null ) {
323- $ image = $ this ->images [$ src ];
322+ $ images = $ this ->images ;
324323
325- if (($ image ['width ' ] >= $ this ->config ['minImageWidth ' ]) && ($ image ['height ' ] >= $ this ->config ['minImageHeight ' ])) {
326- return $ src ;
327- }
324+ if ($ images ) {
325+ $ images = [$ images ];
328326 }
329-
330- return ;
327+ } else {
328+ $ images = Utils:: sortByProviders ( $ this -> images ) ;
331329 }
332330
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 ) {
335333 $ image = $ this ->images [$ key ];
336334
337335 if (($ image ['width ' ] >= $ this ->config ['minImageWidth ' ]) && ($ image ['height ' ] >= $ this ->config ['minImageHeight ' ])) {
@@ -382,11 +380,8 @@ public function getHeight()
382380 */
383381 public function getAspectRatio ()
384382 {
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 );
390385 }
391386 }
392387
0 commit comments