Skip to content

Unable to use Firebase Resize Image Extension when uploading from Unity SDK #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ChristianMcFarlaneWork opened this issue Jul 14, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ChristianMcFarlaneWork
Copy link

Unity Version: Unity 2019.4.28f1
Firebase SDK version: 7.2.0

Hopefully this is the right place for this issue.

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'.

We think that it's an issue with the SDK and setting the metadata after the file has already been finalized on the server end and the function has already been invoked. However other than that we are in the dark as to why this is happening,.

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, so we are looking to get a fix for this issue to avoid that.

@cynthiajoan
Copy link
Contributor

Close because of duplicated.

@cynthiajoan cynthiajoan added the duplicate This issue or pull request already exists label May 5, 2022
@firebase firebase locked and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants