Exemplo n.º 1
0
 public function get_image_path()
 {
     if ($this->image_owner_id) {
         $owner = Thrash::get($this->image_owner_id);
         if ($owner->slices > 0) {
             $res = array();
             for ($i = 0; $i < $owner->slices; $i++) {
                 array_push($res, "{$owner->image_storage_base}{$owner->code}_{$i}.png");
             }
             return $res;
         } else {
             return array("{$owner->image_storage_base}{$owner->code}.png");
         }
     } else {
         if ($this->slices > 0) {
             $res = array();
             for ($i = 0; $i < $this->slices; $i++) {
                 array_push($res, "{$this->image_storage_base}{$this->code}_{$i}.png");
             }
             return $res;
         } else {
             return array("{$this->image_storage_base}{$this->code}.png");
         }
     }
 }