| @@ 111-116 (lines=6) @@ | ||
| 108 | public function updateImageProperty(&$property, $entry, $version=null) { |
|
| 109 | $image = new \OC_Image(); |
|
| 110 | $image->loadFromData($entry); |
|
| 111 | if (strcmp($version, '4.0') == 0) { |
|
| 112 | $type = $image->mimeType(); |
|
| 113 | } else { |
|
| 114 | $arrayType = explode('/', $image->mimeType()); |
|
| 115 | $type = strtoupper(array_pop($arrayType)); |
|
| 116 | } |
|
| 117 | $property->add('ENCODING', 'b'); |
|
| 118 | $property->add('TYPE', $type); |
|
| 119 | $property->setValue($image->__toString()); |
|
| @@ 174-179 (lines=6) @@ | ||
| 171 | for ($i=0; $i<count($v_property); $i++) { |
|
| 172 | $image = new \OC_Image(); |
|
| 173 | $image->loadFromData($ldap_entry); |
|
| 174 | if (strcmp($version, '4.0') == 0) { |
|
| 175 | $type = $image->mimeType(); |
|
| 176 | } else { |
|
| 177 | $arrayType = explode('/', $image->mimeType()); |
|
| 178 | $type = strtoupper(array_pop($arrayType)); |
|
| 179 | } |
|
| 180 | $v_property[$i]->add('ENCODING', 'b'); |
|
| 181 | $v_property[$i]->add('TYPE', $type); |
|
| 182 | $v_property[$i]->setValue($image->__toString()); |
|
| @@ 447-452 (lines=6) @@ | ||
| 444 | // For vCard 3.0 the type must be e.g. JPEG or PNG |
|
| 445 | // For version 4.0 the full mimetype should be used. |
|
| 446 | // https://tools.ietf.org/html/rfc2426#section-3.1.4 |
|
| 447 | if (strval($this->VERSION) === '4.0') { |
|
| 448 | $type = $photo->mimeType(); |
|
| 449 | } else { |
|
| 450 | $type = explode('/', $photo->mimeType()); |
|
| 451 | $type = strtoupper(array_pop($type)); |
|
| 452 | } |
|
| 453 | if (isset($this->PHOTO)) { |
|
| 454 | $this->remove('PHOTO'); |
|
| 455 | } |
|