I’m facing a strange problem with the thumbnail functionality of our inhouse Shotgrid user interface.
It is based on Python and the current workflow is as follows:
- The inhouse tool exports a screengrab as a temporary PNG to the users local drive.
- This local PNG file is then uploaded to Shotgun with the “upload_thumbnail(entity_type, entity_id, source_path)” method of a standard “shotgun_api3.shotgun.Shotgun” object.
- Then the problem already occurs: Being logged in Shotgrid with my browser, I see that a thumbnail appears for the matching entity, but at first only a placeholder image appears (for example in the list view of all Assets, one asset should receive the new thumbnail, but in the list view it only receives a placeholder).
- Clicking on the asset, I open the asset detail view and still only the placeholder image appears.
- When I click on the placeholder image in the detail view, and select “view image”, I get redirected to the Amazon AWS server hosting the image and THE CORRECT IMAGE THUMBNAIL is being shown. So it should already be there.
- Next step is, our inhouse tool attempts to download the thumbnail image to a local cache by accessing the web address “https://(our-site).shotgunstudio.com/thumbnail/(Entity_Type)/(Entity_ID)” and executing the “tank.util.shotgun.download → download_url(sg, url, location)” method.
- The downloaded file shows only the placeholder image, not the actual image which is present on the Amazon AWS server. When I enter the above address in the browser, it redirects to the correct image on the AWS server.
- I’ve been experimenting with adding a time delay between the upload and the download of the thumbnail (trying out between 20 up to 90 seconds) and it seemed like sometimes it returns the correct thumbnail, but even with 90 seconds delay I could not guarantee that the correct thumbnail is being downloaded and not the placeholder.
What is goind wrong here? Is there something that needs to be changed in our Shotgrid server settings or maybe in the upload / download methods?
Or is there no other way than to increase to upload / download delay to some ridiculously high value? Since I can already see the image being there in the browser, I suppose this isn’t the source of the problem.