Hi all,
in fact i´m not sure where this really fits in, so admins: feel free to move this to a better fitting forum.
In my own php code i´m accessing Gallery2 through GalleryEmbed and GalleryCoreApi.
With calling GalleryCoreApi::createAlbum and GalleryCoreApi::addItemToAlbum i´m adding images to my gallery which works pretty well.
But later, when i´m trying to display them on my website, i go through the derivatives (GalleryCoreApi::fetchResizesByItemIds) and when i´m accessing the width Property it returns 0;
Only after i was accessing the resize through the Gallery2 WebInterface it works and seems to be created.
I tried to call rebuildDerivativeCacheIfNotCurrent already, which did not help.
What is the correct way, to ensure my resizes are created by code?
Or is there another correct way of accessing the resized items?
I hope someone can assist me in this...
tia,
alois
Posts: 32509
after calling rebuildDerivativeCacheIfNotCurrent(), do a list ($ret, $derivative) = $derivative->refresh() since your object is in memory and doesn't get updated automatically when some other method changes the underlying entity.
> What is the correct way, to ensure my resizes are created by code?
resizes get generated properly either way. to force it to generate it at some point, call rebuildDerivativeCacheIfNotCurrent().
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 3
perfect! works like a charm.
Thanks a lot for this!