(2f2a6df6a) Fixed crashing when attempting to publish a sub with a preview image larger than 1MB on the Steam Workshop. Closes #1400
This commit is contained in:
@@ -736,6 +736,11 @@ namespace Barotrauma
|
||||
sub.PreviewImage.Texture.SaveAsPng(s, (int)sub.PreviewImage.size.X, (int)sub.PreviewImage.size.Y);
|
||||
itemEditor.PreviewImage = previewImagePath;
|
||||
}
|
||||
if (new FileInfo(previewImagePath).Length > 1024 * 1024)
|
||||
{
|
||||
new GUIMessageBox(TextManager.Get("Error"), TextManager.Get("WorkshopItemPreviewImageTooLarge"));
|
||||
itemEditor.PreviewImage = SteamManager.DefaultPreviewImagePath;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user