Skip to content

Commit db86bd7

Browse files
authored
Merge pull request #168 from dli7319/gemini
GeminiManager: Reduce jpeg quality
2 parents 7fb3ec9 + ad77f95 commit db86bd7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/addons/ai/GeminiManager.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export class GeminiManager extends xb.Script<GeminiManagerEventMap> {
4141

4242
scheduleAheadTime = DEFAULT_SCHEDULE_AHEAD_TIME;
4343

44+
// Type and quality settings for sending the camera feed to Gemini.
45+
cameraMimeType = 'image/jpeg';
46+
cameraQuality = 0.8;
47+
4448
constructor() {
4549
super();
4650
}
@@ -175,8 +179,8 @@ export class GeminiManager extends xb.Script<GeminiManagerEventMap> {
175179
try {
176180
const base64Image = await this.xrDeviceCamera!.getSnapshot({
177181
outputFormat: 'base64',
178-
mimeType: 'image/jpeg',
179-
quality: 1,
182+
mimeType: this.cameraMimeType,
183+
quality: this.cameraQuality,
180184
});
181185
if (typeof base64Image == 'string') {
182186
// Strip the data URL prefix if present

0 commit comments

Comments
 (0)