Skip to content

Commit

Permalink
Updates to ThumbnailLoader and ThumbnailService
Browse files Browse the repository at this point in the history
ThumbnailLoader calls new API, checks if image has pyramids and can determine what state a thumbnail is in if it is missing
ThumbnailBean has additional simple load method that only returns a thumbnail if is available, otherwise returns an empty array
  • Loading branch information
rgozim committed Aug 21, 2018
1 parent bc320b3 commit 78727d9
Show file tree
Hide file tree
Showing 9 changed files with 469 additions and 418 deletions.
32 changes: 31 additions & 1 deletion components/blitz/resources/omero/api/ThumbnailStore.ice
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ module omero {
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned.
* cache and returned. If the thumbnail is missing, a clock will
* be returned to signify that the thumbnail is yet to be generated.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
Expand All @@ -112,6 +113,35 @@ module omero {
*/
idempotent Ice::ByteSeq getThumbnail(omero::RInt sizeX, omero::RInt sizeY) throws ServerError;

/**
* Retrieves a thumbnail for a pixels set using a given set of
* rendering settings (RenderingDef). If the thumbnail exists
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned. If the thumbnail is still to be generated, an empty array will
* be returned.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @param sizeY the Y-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @throws ApiUsageException
* if:
* <ul>
* <li><code>sizeX</code> > pixels.sizeX</li>
* <li><code>sizeX</code> is negative</li>
* <li><code>sizeY</code> > pixels.sizeY</li>
* <li><code>sizeY</code> is negative</li>
* <li>{@link #setPixelsId} has not yet been called</li>
* </ul>
* @return a JPEG thumbnail byte buffer
* @see #getThumbnailDirect
*/
idempotent Ice::ByteSeq getThumbnailWithoutDefault(omero::RInt sizeX, omero::RInt sizeY) throws ServerError;

/**
* Retrieves a number of thumbnails for pixels sets using
* given sets of rendering settings (RenderingDef). If the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import omero.api.AMD_ThumbnailStore_createThumbnailsByLongestSideSet;
import omero.api.AMD_ThumbnailStore_getRenderingDefId;
import omero.api.AMD_ThumbnailStore_getThumbnail;
import omero.api.AMD_ThumbnailStore_getThumbnailWithoutDefault;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSide;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSideDirect;
import omero.api.AMD_ThumbnailStore_getThumbnailByLongestSideSet;
Expand Down Expand Up @@ -126,6 +127,12 @@ public void getThumbnail_async(AMD_ThumbnailStore_getThumbnail __cb,

}

public void getThumbnailWithoutDefault_async(AMD_ThumbnailStore_getThumbnailWithoutDefault __cb,
RInt sizeX, RInt sizeY, Current __current) throws ServerError {
callInvokerOnRawArgs(__cb, __current, sizeX, sizeY);

}

public void resetDefaults_async(AMD_ThumbnailStore_resetDefaults __cb,
Current __current) throws ServerError {
callInvokerOnRawArgs(__cb, __current);
Expand Down
29 changes: 29 additions & 0 deletions components/common/src/ome/api/ThumbnailStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,35 @@ public interface ThumbnailStore extends StatefulServiceInterface {
* @see #getThumbnailDirect(Integer, Integer)
*/
public byte[] getThumbnail(Integer sizeX, Integer sizeY);

/**
* Retrieves a thumbnail for a pixels set using a given set of
* rendering settings (RenderingDef). If the thumbnail exists
* in the on-disk cache it will be returned directly,
* otherwise it will be created as in
* {@link #getThumbnailDirect}, placed in the on-disk
* cache and returned. If the thumbnail is still to be generated, an empty array will
* be returned.
*
* @param sizeX the X-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @param sizeY the Y-axis width of the thumbnail.
* <code>null</code> specifies the default size
* of 48.
* @throws ApiUsageException
* if:
* <ul>
* <li><code>sizeX</code> > pixels.sizeX</li>
* <li><code>sizeX</code> is negative</li>
* <li><code>sizeY</code> > pixels.sizeY</li>
* <li><code>sizeY</code> is negative</li>
* <li>{@link #setPixelsId} has not yet been called</li>
* </ul>
* @return a JPEG thumbnail byte buffer
* @see #getThumbnailDirect
*/
public byte[] getThumbnailWithoutDefault(Integer sizeX, Integer sizeY);

/**
* Retrieves a number of thumbnails for pixels sets using given sets of
Expand Down
Loading

0 comments on commit 78727d9

Please sign in to comment.