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
logger.LogError(imageGeneratorError,"Error generating store images for image of size {size} for {platforms} with padding {padding} and color {color}.",request.BaseImage.Length,string.Join(", ",request.Platform),request.Padding,request.Color);
93
+
logger.LogError(imageGeneratorError,"Error generating store images for image of size {size} for {platforms} with padding {padding} and color {color}.",request.BaseImage.Length,string.Join(", ",request.Platforms),request.Padding,request.BackgroundColor);
93
94
returnStatusCode(500,$"An error occurred while generating store images: {imageGeneratorError.Message}");
Copy file name to clipboardExpand all lines: apps/pwabuilder/Models/StoreImageCreationOptions.cs
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ namespace PWABuilder.Models;
5
5
/// <summary>
6
6
/// Represents a request to generate store images from a base image.
7
7
/// </summary>
8
-
publicsealedclassStoreImageGenerationRequest
8
+
publicsealedclassStoreImageCreationOptions
9
9
{
10
10
/// <summary>
11
11
/// The base image file uploaded by the client.
@@ -19,13 +19,13 @@ public sealed class StoreImageGenerationRequest
19
19
publicrequireddoublePadding{get;set;}
20
20
21
21
/// <summary>
22
-
/// The background color to use. Can be a hex color, named color, or "transparent".
22
+
/// The background color to use. Can be a hex color, named color, or "transparent". This color will be used when adding any specified padding or for the background when bringing the image into a non-square target.
23
23
/// </summary>
24
-
publicrequiredstringColor{get;set;}
24
+
publicrequiredstringBackgroundColor{get;set;}
25
25
26
26
/// <summary>
27
27
/// One or more target platform identifiers for which store images should be generated.
// Create a single, reusable Puppeteer browser instance. This can be used across different requests so that we're not spinning up multiple browsers for each request.
Copy file name to clipboardExpand all lines: apps/pwabuilder/Services/IOS/IOSImageWriter.cs
+26-82Lines changed: 26 additions & 82 deletions
Original file line number
Diff line number
Diff line change
@@ -5,29 +5,27 @@
5
5
usingPWABuilder.IOS.Common;
6
6
usingPWABuilder.IOS.Models;
7
7
usingPWABuilder.Models;
8
+
usingPWABuilder.Services;
8
9
9
10
namespacePWABuilder.IOS.Services
10
11
{
11
12
/// <summary>
12
-
/// Creates the recommended Windows package images using images from the <see cref="WindowsAppPackageOptions"/>, images from the PWA's web app manifest, and images generated on behalf of the user from the PWABuilder app image generator service.
13
+
/// Creates the recommended iOS package images using images from the <see cref="IOSAppPackageOptions"/>, images from the PWA's web app manifest, and images generated on behalf of the user from the PWABuilder image generator service.
13
14
/// </summary>
14
-
/// <remarks>
15
-
/// PWABuilder app image generator service is at https://www.pwabuilder.com/imageGenerator
$"Couldn't find a suitable base image from which to generate all Windows package images. Please ensure your web app manifest has a square PNG image 512x512 or larger. Base image sources: {string.Join(", ",baseImageSources)}"
131
-
);
132
-
}
133
-
134
-
privateasyncTask<Uri>CreateIOSImagesZip(
135
-
byte[]image,
136
-
doublepadding,
137
-
stringbackgroundColor
138
-
)
139
-
{
140
-
// The image generation API takes the following parameters, documented here: https://github.com/pwa-builder/pwabuilder-Image-Generator
141
-
// - fileName: bytes
142
-
// - padding: double (0 = no padding, 1 = max padding)
143
-
// - color: hex color, named color, or "transparent"
144
-
// - platform: ios
145
-
// - colorChanged: if colorOption = "choose", this should be 1. Otherwise, omit.
$"Couldn't find a suitable base image from which to generate all iOS package images. Please ensure your web app manifest has a square PNG image 512x512 or larger. Base image sources: {string.Join(", ",baseImageSources)}"
$"Unable to generate images for Windows package. The image URI returned from the image generator service, '{imagesResult.Uri}', is an invalid URI. Raw response: {imagesResponseString}"
@@ -52,7 +52,7 @@ public async Task<byte[]> Create(IOSAppPackageOptions.Validated options)
52
52
53
53
// Create any missing images for the iOS template.
54
54
// This should be done before project.ApplyChanges(). Otherwise, it'll attempt to write the images to the "pwa-shell" directory, which no longer exists after ApplyChanges().
0 commit comments