1

We're trying to use the Resize Image Extension with the Unity Firebase SDK to generate thumbnails to upload to our storage. However the extension is never being called even after setting custom metadata to ensure that our content-type is correct.

The code we've been using is along the lines of this

byte[] imageBytes = previewTexture.EncodeToPNG();
MetadataChange metadata = new MetadataChange() { ContentType = "image/png" };
bucket.Child("CustomMaps/UserId/Previews/MapID.png").PutBytesAsync(imageBytes, metadata);

And this is what we see in the logs for our image upload

Function execution started 
---
Started execution of extension with configuration {"bucket":"CorrectAppBucket","deleteOriginalFile":1,"imageSizes":["128x128"],"imageTypes":["false"],"includePathList":["/CustomMaps/*/Previews"]}
---
File of type 'application/x-www-form-urlencoded' is not an image, no processing is required
---
Function execution took 7 ms, finished with status: 'ok'  

But looking at the metadata in the dashboard shows that the metadata was set correctly, with our Content-Type showing up as 'image/png'.

Is there just something we're missing? The hints on the extension seem to use the admin SDK for setting metadata when uploading a byte array, is it that we need to be using the admin SDK at all to set metadata for the plugin to run? or is it just an issue with the SDK itself?

For now we are forced to manually generate smaller versions on client-side which is much slower on mobile and will eat up more of our bandwidth.

Any and all help is appreciated.

0 Answers0