Derivatives question

mihed

Joined: 2006-12-30
Posts: 11
Posted: Sat, 2007-01-06 21:27

I was wondering how to access the thumbnail that is displayed in a newly created album, once you upload a picture it selects that picture as the default thumbnail.

I'm trying to set $item to whatever the current thumbnail is for that album.

list ($ret, $albumItem) = GalleryCoreApi::loadEntitiesById($itemId);
if ($ret) {
return array($ret, null);
}

list ($ret, $item) = GalleryCoreApi::fetchDerivativesBySourceIds($albumItem, DERIVATIVE_TYPE_IMAGE_THUMBNAIL);
if ($ret) {
return array($ret, null);
}

list ($ret, $path) = $item->fetchPath();
if ($ret) {
return array($ret, null);
}

I do not, however, think I am coding this correctly :) any ideas?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2007-04-12 04:30