MCPcopy
hub / github.com/mobile-next/mobile-mcp / toBuffer

Method toBuffer

src/image-utils.ts:33–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 public toBuffer(): Buffer {
34 if (isSipsInstalled()) {
35 try {
36 return this.toBufferWithSips();
37 } catch (error) {
38 trace(`Sips failed, falling back to ImageMagick: ${error}`);
39 }
40 }
41
42 try {
43 return this.toBufferWithImageMagick();
44 } catch (error) {
45 trace(`ImageMagick failed: ${error}`);
46 throw new Error("Image scaling unavailable (requires Sips or ImageMagick).");
47 }
48 }
49
50 private qualityToSips(q: number): "low" | "normal" | "high" | "best" {
51 if (q >= 90) {

Callers 1

createMcpServerFunction · 0.80

Calls 4

toBufferWithSipsMethod · 0.95
traceFunction · 0.90
isSipsInstalledFunction · 0.85

Tested by

no test coverage detected