icosa-foundation / icosa-gallery

Icosa Gallery is a 3D model hosting solution, intended as a replacement for Google's Poly
https://icosa.gallery
Apache License 2.0
8 stars 0 forks source link

Thumbnail field not populated when uploading from Open Brush #5

Closed andybak closed 4 months ago

andybak commented 4 months ago

The thumbnail was created fine, uploaded fine and correctly transferred to google storage.

And it's in the json when I check via the Django Admin. (e.g. admin/api/asset/448471045473566832/change/ )

I think it's the logic here: fastapi.app.routers.assets.upload_background

I recall that's meant to handle both "thumbnail in the zip" (from Open Brush) and "thumbnail separately" (from the website) - but it's obviously buggy for the former.

When I basically copied the GCP url from the json to the thumbnail field it worked fine.

jamesrampton commented 4 months ago

@andybak can you please supply a zip file that I can test with? I think I see where the issue is.

andybak commented 4 months ago

archive.zip

andybak commented 4 months ago

that has been unzipped and rezipped. Here's another that hasn't but it will also hit the size limit in #6

archive.zip

jamesrampton commented 4 months ago

I've reworked the web zip upload code to parse out a thumbnail and save its path to the db. We should be doing that on web anyway, but hopefully it also fixes it for unity. Please let me know @andybak.

andybak commented 4 months ago

Tried from within Open Brush and the thumbnail field wasn't populated.

I then uploaded the same zip that Open Brush uploaded except via the web front-end and again no thumbnail.

The zip I tried is attached. Am I doing something dumb?

archive.zip

jamesrampton commented 4 months ago

archive_big.zip

I just redeployed. The attached works for me if you can test with that for the time being. I'll investigate why the one you attached recently doesn't

andybak commented 4 months ago

looking in django there's some oddities - some from my side and some from yours.

  1. In the upload with a thumb I can see thumbnailpng instead of thumbnail.png
  2. The list of assets for the upload with the thumb only includes the tilt file - no gltf/glb - therefore the actual scene doesn't load on the web
  3. In the zip file for the upload with the thumb, the gltf lacks a file extension whereas the zip file for the upload without a thumb is correctly named whatever.gltf

Number 3 is a bug from my side - I think it's related to the fact that scene was a read-only example sketch rather than a regular saved sketch. The other 2 points hopefully give you a clue.

andybak commented 4 months ago

Just a thought - Is the loop through the zip contents exiting early on some condition that it shouldn't?

jamesrampton commented 4 months ago
  1. This is fixed
  2. This scene is displaying correctly for me, is this the one you were having issues with? https://icosa.ixxy.co.uk/edit/jimothy/eoaUKCs4YR8
andybak commented 4 months ago

Looks good to me.