I can currently retrieve a thumbnail of an image file just fine with the following code:
BoxImageRequestObject obj = null;
thumbnail = client.getFilesManager().getThumbnail( entryId, fileExtention, obj );
However, the thumbnail obtained is too small. So, I need to be able to request a certain size. I have tried using pagePreviewRequestObject method that allows for setting the dimensions. But it doesn't work.
BoxImageRequestObject obj = BoxImageRequestObject.pagePreviewRequestObject(page, minWidth, maxWidth, minHeight, maxHeight);
thumbnail = client.getFilesManager().getThumbnail( entryId, fileExtention, obj );
Please tell me how to request a thumbnail by size using the Box Java SDK.
Thanks!
The BoxImageRequestObject is for the purpose tweaking requests. In this scenario you'll want to do a : BoxImageRequestObject.previewRequestObject().setMinHeight(size).setMaxHeight(size).setMinWidth(size).setMaxWidth(size);
This way you are specifically requesting a thumbnail of a certain size. However please be aware that although server always try to render the thumbnail with the size requested, the size requested may not exist in server. In this case server will get an thumbnail with different size back.