We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66b3b9f commit 48b658dCopy full SHA for 48b658d
packages/vertexai/src/requests/imagen-image-format.ts
@@ -15,6 +15,8 @@
15
* limitations under the License.
16
*/
17
18
+import { logger } from "../logger";
19
+
20
export class ImagenImageFormat {
21
mimeType: string;
22
compressionQuality?: number;
@@ -24,6 +26,9 @@ export class ImagenImageFormat {
24
26
}
25
27
28
static jpeg(compressionQuality?: number): ImagenImageFormat {
29
+ if (compressionQuality && (compressionQuality < 0 || compressionQuality > 100)) {
30
+ logger.warn(`Invalid JPEG compression quality of ${compressionQuality} specified; the supported range is [0, 100].`);
31
+ }
32
return { mimeType: 'image/jpeg', compressionQuality };
33
34
0 commit comments