{"version":3,"sources":["../src/index.ts","../node_modules/tsup/assets/cjs_shims.js","../src/binaries.ts","../src/buffer-utils.ts","../src/exec.ts","../src/temp-path.ts"],"sourcesContent":["import { chmodSync } from 'node:fs';\nimport { allBinaryPaths, setBinaryDir } from './binaries.js';\nimport { base64str2webp, buffer2webp } from './buffer-utils.js';\nimport { optionTokens, runWebp } from './exec.js';\n\nexport type { WebpTool } from './binaries.js';\nexport { setBinaryDir, BIN_DIR_ENV } from './binaries.js';\n\n/** A single frame passed to {@link webpmux_animate}. */\nexport interface AnimationFrame {\n  /** Path to the source `.webp` frame. */\n  path: string;\n  /** webpmux frame options, e.g. `\"+100\"` or `\"+100+50+50+1+b\"`. */\n  offset: string;\n}\n\n/**\n * Grant `0o755` to the bundled webp binaries. Required once on Linux/macOS\n * after install, where npm may not preserve the executable bit. No-op-safe to\n * call on Windows.\n */\nexport function grant_permission(): void {\n  for (const exe of allBinaryPaths()) {\n    chmodSync(exe, 0o755);\n  }\n}\n\n/**\n * Convert any image (jpeg, png, …) to webp.\n * @param input_image  Path to the source image.\n * @param output_image Path to write the `.webp` output.\n * @param option       cwebp options, e.g. `\"-q 80\"`.\n * @param logging      libwebp logging flag (`\"-quiet\"` by default, `\"-v\"` for verbose).\n */\nexport function cwebp(\n  input_image: string,\n  output_image: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  return runWebp('cwebp', [\n    ...optionTokens(option),\n    String(input_image),\n    '-o',\n    String(output_image),\n    String(logging),\n  ]);\n}\n\n/**\n * Convert a webp image back to another format (jpeg, png, …).\n * @param input_image  Path to the source `.webp` image.\n * @param output_image Path to write the decoded output.\n * @param option       dwebp options, e.g. `\"-o\"`.\n * @param logging      libwebp logging flag.\n */\nexport function dwebp(\n  input_image: string,\n  output_image: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  return runWebp('dwebp', [\n    String(input_image),\n    ...optionTokens(option),\n    String(output_image),\n    String(logging),\n  ]);\n}\n\n/**\n * Convert a gif to an (animated) webp.\n * @param input_image  Path to the source `.gif`.\n * @param output_image Path to write the `.webp` output.\n * @param option       gif2webp options, e.g. `\"-q 80\"`.\n * @param logging      libwebp logging flag.\n */\nexport function gwebp(\n  input_image: string,\n  output_image: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  return runWebp('gif2webp', [\n    ...optionTokens(option),\n    String(input_image),\n    '-o',\n    String(output_image),\n    String(logging),\n  ]);\n}\n\n// Note: webpmux has no logging flag. The trailing `logging` parameter is kept\n// on these functions only for call-site compatibility with 2.x and is ignored\n// — forwarding it made every webpmux call fail with \"Unknown option\" (2.x hid\n// this because it resolved on error instead of rejecting).\n\n/**\n * Add an ICC profile, XMP metadata or EXIF metadata to a webp image.\n * @param option  `\"icc\"`, `\"xmp\"` or `\"exif\"`.\n * @param logging Ignored (webpmux has no logging flag); kept for 2.x compatibility.\n */\nexport function webpmux_add(\n  input_image: string,\n  output_image: string,\n  icc_profile: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  void logging;\n  return runWebp('webpmux', [\n    '-set',\n    ...optionTokens(option),\n    String(icc_profile),\n    String(input_image),\n    '-o',\n    String(output_image),\n  ]);\n}\n\n/**\n * Extract an ICC profile, XMP metadata or EXIF metadata from a webp image.\n * @param option  `\"icc\"`, `\"xmp\"` or `\"exif\"`.\n * @param logging Ignored (webpmux has no logging flag); kept for 2.x compatibility.\n */\nexport function webpmux_extract(\n  input_image: string,\n  icc_profile: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  void logging;\n  return runWebp('webpmux', [\n    '-get',\n    ...optionTokens(option),\n    String(input_image),\n    '-o',\n    String(icc_profile),\n  ]);\n}\n\n/**\n * Strip an ICC profile, XMP metadata or EXIF metadata from a webp image.\n * @param option  `\"icc\"`, `\"xmp\"` or `\"exif\"`.\n * @param logging Ignored (webpmux has no logging flag); kept for 2.x compatibility.\n */\nexport function webpmux_strip(\n  input_image: string,\n  output_image: string,\n  option: string,\n  logging = '-quiet',\n): Promise<string> {\n  void logging;\n  return runWebp('webpmux', [\n    '-strip',\n    ...optionTokens(option),\n    String(input_image),\n    '-o',\n    String(output_image),\n  ]);\n}\n\n/**\n * Create an animated webp from an array of webp frames.\n * @param input_images Frames as `{ path, offset }` objects.\n * @param loop         Number of loops (`\"0\"` = forever).\n * @param bgcolor      Canvas background, e.g. `\"255,255,255,255\"`.\n * @param logging      Ignored (webpmux has no logging flag); kept for 2.x compatibility.\n */\nexport function webpmux_animate(\n  input_images: AnimationFrame[],\n  output_image: string,\n  loop: string | number,\n  bgcolor: string,\n  logging = '-quiet',\n): Promise<string> {\n  void logging;\n  const args: string[] = [];\n  for (const frame of input_images) {\n    args.push('-frame', String(frame.path), String(frame.offset));\n  }\n  args.push('-loop', String(loop), '-bgcolor', String(bgcolor), '-o', String(output_image));\n  return runWebp('webpmux', args);\n}\n\n/**\n * Extract a single frame from an animated webp.\n * @param logging Ignored (webpmux has no logging flag); kept for 2.x compatibility.\n */\nexport function webpmux_getframe(\n  input_image: string,\n  output_image: string,\n  frame_number: string | number,\n  logging = '-quiet',\n): Promise<string> {\n  void logging;\n  return runWebp('webpmux', [\n    '-get',\n    'frame',\n    String(frame_number),\n    String(input_image),\n    '-o',\n    String(output_image),\n  ]);\n}\n\n/** Convert a base64-encoded image string to a base64-encoded webp string. */\nexport function str2webpstr(\n  base64str: string,\n  image_type: string,\n  option: string,\n  extra_path?: string,\n): Promise<string> {\n  return base64str2webp(base64str, image_type, option, extra_path);\n}\n\n/** Convert an image buffer to a webp buffer. */\nexport function buffer2webpbuffer(\n  buffer: Buffer | Uint8Array,\n  image_type: string,\n  option: string,\n  extra_path?: string,\n): Promise<Buffer> {\n  return buffer2webp(buffer, image_type, option, extra_path);\n}\n\n// Default export mirrors the named exports so both\n// `import webp from 'webp-converter'` and `const webp = require('webp-converter')` work.\nconst webp = {\n  grant_permission,\n  setBinaryDir,\n  cwebp,\n  dwebp,\n  gwebp,\n  webpmux_add,\n  webpmux_extract,\n  webpmux_strip,\n  webpmux_animate,\n  webpmux_getframe,\n  str2webpstr,\n  buffer2webpbuffer,\n};\n\nexport default webp;\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n  typeof document === \"undefined\" \n    ? new URL(`file:${__filename}`).href \n    : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n      ? document.currentScript.src \n      : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","import { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport path from 'node:path';\n\n/** The four webp command-line tools this library wraps. */\nexport type WebpTool = 'cwebp' | 'dwebp' | 'gif2webp' | 'webpmux';\n\nconst ALL_TOOLS: readonly WebpTool[] = ['cwebp', 'dwebp', 'gif2webp', 'webpmux'];\n\n// Both the built output (dist/) and the TS sources (src/) live one directory\n// below the package root, so the bundled bin/ folder is always one level up.\nconst packageRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');\n\n/** Env var pointing to a directory of custom webp binaries. */\nexport const BIN_DIR_ENV = 'WEBP_CONVERTER_BIN_DIR';\n\n// Programmatic override set via setBinaryDir(); takes precedence over the env var.\nlet customBinDir: string | undefined;\n\n/**\n * Point the library at your own directory of webp binaries (e.g. a newer\n * libwebp release, or a platform not bundled with the package). The directory\n * must contain the tools directly: `cwebp`, `dwebp`, `gif2webp`, `webpmux`\n * (with `.exe` extensions on Windows).\n *\n * Pass `undefined` to clear the override and go back to the bundled binaries.\n * Takes precedence over the `WEBP_CONVERTER_BIN_DIR` environment variable.\n */\nexport function setBinaryDir(dir: string | undefined): void {\n  customBinDir = dir && dir.trim() ? dir : undefined;\n}\n\n/** The active override directory (programmatic first, then env var), if any. */\nfunction overrideDir(): string | undefined {\n  if (customBinDir) return customBinDir;\n  const fromEnv = process.env[BIN_DIR_ENV];\n  return fromEnv && fromEnv.trim() ? fromEnv : undefined;\n}\n\ninterface PlatformTarget {\n  /** Preferred bin/ subdirectory for the current platform+arch. */\n  dir: string;\n  /** Fallback subdirectory (e.g. run the x64 build under arm64 emulation). */\n  fallback?: string;\n  /** Executable extension. */\n  ext: string;\n}\n\nfunction resolveTarget(): PlatformTarget {\n  const { platform, arch } = process;\n\n  if (platform === 'darwin') {\n    return arch === 'arm64'\n      ? { dir: 'libwebp_osx_arm64', fallback: 'libwebp_osx', ext: '' }\n      : { dir: 'libwebp_osx', ext: '' };\n  }\n\n  if (platform === 'linux') {\n    return arch === 'arm64'\n      ? { dir: 'libwebp_linux_arm64', fallback: 'libwebp_linux', ext: '' }\n      : { dir: 'libwebp_linux', ext: '' };\n  }\n\n  if (platform === 'win32' && arch === 'x64') {\n    return { dir: 'libwebp_win64', ext: '.exe' };\n  }\n\n  throw new Error(\n    `webp-converter: unsupported platform \"${platform}/${arch}\". ` +\n      'Supported: darwin (x64/arm64), linux (x64/arm64), win32 (x64).',\n  );\n}\n\n/**\n * Absolute path to the requested webp binary.\n *\n * Resolution order: a directory set via {@link setBinaryDir} → the\n * `WEBP_CONVERTER_BIN_DIR` env var → the bundled binary for this platform\n * (preferring a native arm64 build, falling back to x64 when not bundled).\n */\nexport function binaryPath(tool: WebpTool): string {\n  const exeExt = process.platform === 'win32' ? '.exe' : '';\n\n  // Developer-supplied binaries win over anything bundled. Checked before\n  // resolveTarget() so custom binaries work even on platforms we don't bundle.\n  const custom = overrideDir();\n  if (custom) {\n    return path.join(custom, `${tool}${exeExt}`);\n  }\n\n  const { dir, fallback, ext } = resolveTarget();\n  const primary = path.join(packageRoot, 'bin', dir, 'bin', `${tool}${ext}`);\n  if (existsSync(primary)) return primary;\n\n  if (fallback) {\n    const alt = path.join(packageRoot, 'bin', fallback, 'bin', `${tool}${ext}`);\n    if (existsSync(alt)) return alt;\n  }\n\n  // Return the primary path anyway so exec surfaces a clear ENOENT if truly missing.\n  return primary;\n}\n\n/** Absolute paths to every bundled webp binary for the current platform. */\nexport function allBinaryPaths(): string[] {\n  return ALL_TOOLS.map(binaryPath);\n}\n","import { randomUUID } from 'node:crypto';\nimport { readFile, unlink, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { optionTokens, runWebp } from './exec.js';\nimport { tempDir } from './temp-path.js';\n\n/**\n * Write `data` to a temp file, convert it to webp with cwebp, read the result\n * back, and always clean up both temp files (even if conversion fails).\n */\nasync function encodeToWebp(\n  data: Buffer,\n  imageType: string,\n  option: string,\n  extraPath?: string,\n): Promise<Buffer> {\n  const dir = tempDir(extraPath);\n  const id = randomUUID();\n  const inputPath = path.join(dir, `${id}.${imageType}`);\n  const webpPath = path.join(dir, `${id}.webp`);\n\n  await writeFile(inputPath, data);\n  try {\n    await runWebp('cwebp', [...optionTokens(option), inputPath, '-o', webpPath, '-quiet']);\n    return await readFile(webpPath);\n  } finally {\n    await Promise.allSettled([unlink(inputPath), unlink(webpPath)]);\n  }\n}\n\n/** Convert a base64-encoded image string to a base64-encoded webp string. */\nexport async function base64str2webp(\n  base64str: string,\n  imageType: string,\n  option: string,\n  extraPath?: string,\n): Promise<string> {\n  const webp = await encodeToWebp(Buffer.from(base64str, 'base64'), imageType, option, extraPath);\n  return webp.toString('base64');\n}\n\n/** Convert an image buffer to a webp buffer. */\nexport async function buffer2webp(\n  buffer: Buffer | Uint8Array,\n  imageType: string,\n  option: string,\n  extraPath?: string,\n): Promise<Buffer> {\n  return encodeToWebp(Buffer.from(buffer), imageType, option, extraPath);\n}\n","import { execFile } from 'node:child_process';\nimport { binaryPath, type WebpTool } from './binaries.js';\n\n/**\n * Split a free-form option string (e.g. `\"-q 80\"`) into individual argv tokens.\n * `null`/`undefined`/empty produce no tokens.\n */\nexport function optionTokens(option: unknown): string[] {\n  if (option == null) return [];\n  return String(option).trim().split(/\\s+/).filter(Boolean);\n}\n\n/**\n * Run a webp binary with a real argv array and **no shell**.\n *\n * Each argument is passed to the binary verbatim, so filenames or options\n * containing spaces or shell metacharacters can never be re-interpreted as a\n * command. This closes the command-injection hole (CWE-78) present in every\n * 2.x release, where arguments were concatenated into a `sh -c` string.\n *\n * Rejects when the binary exits non-zero (2.x silently resolved instead).\n */\nexport function runWebp(tool: WebpTool, args: string[]): Promise<string> {\n  return new Promise((resolve, reject) => {\n    execFile(binaryPath(tool), args, (error, stdout, stderr) => {\n      if (error) {\n        reject(error);\n        return;\n      }\n      resolve(stdout || stderr);\n    });\n  });\n}\n","import { existsSync, mkdirSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport path from 'node:path';\n\n/**\n * Resolve the directory used for intermediate files during buffer/base64\n * conversions, creating it if it does not exist. Pass `extraPath` to use your\n * own directory; otherwise a `webp-converter/` folder under the OS temp\n * directory is used.\n *\n * Unlike 2.x (which wrote inside the installed package and threw `ENOENT` on a\n * fresh install), the default lives under `os.tmpdir()` so conversions work on\n * read-only filesystems (Docker, serverless) and are created on demand.\n */\nexport function tempDir(extraPath?: string): string {\n  const dir = extraPath && extraPath.trim() ? extraPath : path.join(tmpdir(), 'webp-converter');\n  if (!existsSync(dir)) {\n    mkdirSync(dir, { recursive: true });\n  }\n  return dir;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ADZ9D,IAAAA,kBAA0B;;;AEA1B,qBAA2B;AAC3B,sBAA8B;AAC9B,uBAAiB;AAKjB,IAAM,YAAiC,CAAC,SAAS,SAAS,YAAY,SAAS;AAI/E,IAAM,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,SAAS,kBACd,QACA,YACA,QACA,YACiB;AACjB,SAAO,YAAY,QAAQ,YAAY,QAAQ,UAAU;AAC3D;AAIA,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,gBAAQ;","names":["import_node_fs","path","import_node_path","import_node_fs","import_node_path","path","path","webp"]}