|
By moodler:
repository/picasa MDL-17473 Use picasa description as the filename if it exists
|
| 432 |
//hacky... |
//hacky... |
| 433 |
$thumbnailinfo = $mediainfo->group->thumbnail[0]->attributes(); |
$thumbnailinfo = $mediainfo->group->thumbnail[0]->attributes(); |
| 434 |
|
|
| 435 |
$files[] = array('title' => (string) $mediainfo->group->title, |
// Derive the nicest file name we can |
| 436 |
|
if (!empty($mediainfo->group->description)) { |
| 437 |
|
$title = shorten_text((string)$mediainfo->group->description, 20, false, ''); |
| 438 |
|
$title = clean_filename($title).'.jpg'; |
| 439 |
|
} else { |
| 440 |
|
$title = (string)$mediainfo->group->title; |
| 441 |
|
} |
| 442 |
|
|
| 443 |
|
$files[] = array( |
| 444 |
|
'title' => $title, |
| 445 |
'date' => userdate($gphoto->timestamp), |
'date' => userdate($gphoto->timestamp), |
| 446 |
'size' => (int) $gphoto->size, |
'size' => (int) $gphoto->size, |
| 447 |
'path' => $gphoto->albumid.'/'.$gphoto->id, |
'path' => $gphoto->albumid.'/'.$gphoto->id, |
| 448 |
'thumbnail' => (string) $thumbnailinfo['url'], |
'thumbnail' => (string) $thumbnailinfo['url'], |
| 449 |
'thumbnail_width' => 72, // 72 is the native maximum dimension |
'thumbnail_width' => 72, // 72 is the native maximum dimension |
| 450 |
'thumbnail_height' => 72, |
'thumbnail_height' => 72, |
| 451 |
'source' => (string) $fullinfo['url'], |
'source' => (string) $fullinfo['url'] |
| 452 |
); |
); |
| 453 |
} |
} |
| 454 |
|
|