Automatically resize images to fit limits (#831)

Resize images for Avatars, Worlds, Gallery, Icons and Emojis when uploading if it exceeds VRChats limits (2000 pixels in any dimension and 10MB file size).
This commit is contained in:
Nekromateion
2024-06-26 13:29:46 +02:00
committed by GitHub
parent 3ab1cf1d48
commit 873c1d38f0
4 changed files with 91 additions and 24 deletions

View File

@@ -217,7 +217,8 @@ namespace VRCX
}
}
var imageData = options["imageData"] as string;
byte[] fileToUpload = Convert.FromBase64CharArray(imageData.ToCharArray(), 0, imageData.Length);
byte[] fileToUpload = AppApi.Instance.ResizeImageToFitLimits(Convert.FromBase64String(imageData));
string fileFormKey = "file";
string fileName = "blob";
string fileMimeType = "image/png";