You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i use var file = await storage.GetFilePreview("6710e6320027465880b0", "67248ee6003b9780a4cc", output: ImageFormat.Jpeg);
👍 Expected behavior
It should get the byte array of the file.
👎 Actual Behavior
It throws an exception:
Appwrite.AppwriteException: Invalid `output` param: Value must be one of (jpg,jpeg,gif,png,webp)
at Appwrite.Client.Call[T](Stringmethod,Stringpath, Dictionary`2headers, Dictionary`2parameters, Func`2convert)
at Program.<Main>$(String[]args)in E:\appwrite\dotnet\TestApp\Program.cs:line 29
at Program.<Main>(String[]args)
The fix is simple in this repo, although i understand that this SDK is auto generated and the fix should be implemented in the generator:
publicTask<byte[]>GetFilePreview(stringbucketId,stringfileId,long?width=null,long?height=null,Appwrite.Enums.ImageGravity?gravity=null,long?quality=null,long?borderWidth=null,string?borderColor=null,long?borderRadius=null,double?opacity=null,long?rotation=null,string?background=null,Appwrite.Enums.ImageFormat?output=null){varapiPath="/storage/buckets/{bucketId}/files/{fileId}/preview".Replace("{bucketId}",bucketId).Replace("{fileId}",fileId);varapiParameters=newDictionary<string,object?>(){{"width",width},{"height",height},{"gravity",gravity},{"quality",quality},{"borderWidth",borderWidth},{"borderColor",borderColor},{"borderRadius",borderRadius},{"opacity",opacity},{"rotation",rotation},{"background",background},// Change this{"output",output?.Value}};varapiHeaders=newDictionary<string,string>(){{"content-type","application/json"}};return_client.Call<byte[]>(method:"GET",path:apiPath,headers:apiHeaders,parameters:apiParameters.Where(it =>it.Value!=null).ToDictionary(it =>it.Key, it =>it.Value)!);}
🎲 Appwrite version
Version 0.10.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
👟 Reproduction steps
When i use
var file = await storage.GetFilePreview("6710e6320027465880b0", "67248ee6003b9780a4cc", output: ImageFormat.Jpeg);
👍 Expected behavior
It should get the byte array of the file.
👎 Actual Behavior
It throws an exception:
The fix is simple in this repo, although i understand that this SDK is auto generated and the fix should be implemented in the generator:
🎲 Appwrite version
Version 0.10.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: