Commits

Bogdan Savluk committed c24f1f9

Allow to pass method params in photo versions as a single value

Comments (0)

Files changed (1)

models/GalleryPhoto.php

         foreach ($this->gallery->versions as $version => $actions) {
             $image = Yii::app()->image->load($path);
             foreach ($actions as $method => $args) {
-                call_user_func_array(array($image, $method), $args);
+                call_user_func_array(array($image, $method), is_array($args) ? $args : array($args));
             }
             $image->save(self::$galleryDir . '/' . $this->getFileName($version) . '.' . self::$galleryExt);
         }
             if (file_exists($img)) {
                 $image = Yii::app()->image->load($img);
                 foreach ($actions as $method => $args) {
-                    call_user_func_array(array($image, $method), $args);
+                    call_user_func_array(array($image, $method), is_array($args) ? $args : array($args));
                 }
                 $image->save(self::$galleryDir . '/' . $this->getFileName($version) . '.' . self::$galleryExt);
             }