# 图片

## 使用内置查看器打开图片

默认配置下，DOpus 会使用内置查看器打开所有图片文件，可以通过以下选项控制：

![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-c647019c4a0d056d0964efdb04972131a7598398%2F%E5%8F%8C%E5%87%BB%E6%96%87%E4%BB%B6-v13.png?alt=media)

关闭该选项后，DOpus 会使用系统默认关联程序来打开图片文件。

<details>

<summary>v12</summary>

默认配置下，DOpus 会使用内置查看器打开所有图片文件和 WAV 文件，这一行为可以通过以下选项控制：

<img src="https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-fba31d48be903440f37b27b293ccc614205e046a%2F%E5%8F%8C%E5%87%BB%E6%96%87%E4%BB%B6.png?alt=media" alt="" data-size="original">

</details>

## 预览

### DOpus 内置

DOpus 内置了对 BMP、PNG、JPEG、GIF（非动画）、ICO（仅最大）、TIFF、Adobe Photoshop PSD、EMF、WMF 格式的支持，同时还内置了以下预览插件：

* Animated GIF（GIF 动画）
* JPEG 2000
* Windows Imgaing Component（HEIF/HEIC、AVIF、DDS）
* WebP

内置支持的优先级高于插件。由于内置支持不是通过插件实现的，无法将其它插件的优先级调整为高于内置，只能通过在预览窗格中手动指定来使用其它插件。

### [MultiView 插件](https://chaoses-ib.gitbook.io/directory-opus/wen-jian-liu-lan/cha-kan/cha-kan-qi#oracle-outside-in-viewer)

支持 BMP、PNG、JPEG、GIF、ICO（部分不兼容）、TIFF、SVG（仅 XML）、Adobe Photoshop PSD、Adobe Illustrator、Adobe InDesign、Microsoft Visio。

可能需要在配置中将 MultiView 插件的优先级调整到其它图片插件之前，或者在预览窗格中手动选择 MultiView 插件来使用。

## PNG 文本字段

DOpus 默认不支持查看 PNG 中的文本字段，可以通过安装 [ExifTool Custom Columns](https://resource.dopus.com/t/exiftool-custom-columns/38975?u=chaoses-ib) 来实现支持（需要 DOpus v13）：

1. 安装 [ExifTool](https://www.exiftool.org/)

   也可通过 [Scoop](https://scoop.sh/) 安装：`scoop install exiftool`
2. 安装 [`ColumnExifTool.js`](https://resource.dopus.com/t/exiftool-custom-columns/38975?u=chaoses-ib)
3. 如果你的 ExitTool 没有安装在 `/programfiles\exiftool\exiftool.exe`，需要手动修改 `ColumnExifTool` 的 `exeExitTool` 配置（必须使用绝对路径，即使相应 EXE 在环境变量中）

   Scoop 的默认路径为：`%USERPROFILE%\scoop\shims\exiftool.exe`
4. 添加 [ExifTool.dop](https://resource.dopus.com/t/exiftool-custom-columns/38975?u=chaoses-ib) 到工具栏，选择要查看的图片，在添加的工具栏中选择 `Tools → Probe Files`，它在当前文件夹会生成一个代码文件，例如：

   ```js
   exifColumns.push_back(GetColumnMap('PNG', 'ComfyScript', '', '', '', '', '', ''));
   exifColumns.push_back(GetColumnMap('PNG', 'ComfyScriptSource', '', '', '', '', '', ''));
   exifColumns.push_back(GetColumnMap('PNG', 'Prompt', '', '', '', '', '', ''));
   ```

   其中每行对应一个 PNG 文本字段。
5. 在 `ColumnExifTool` 的脚本代码尾部添加需要的文本字段的代码

   例如，可以添加以下代码来查看图片生成工具 [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui)、[ComfyScript](https://github.com/Chaoses-Ib/ComfyScript) 和 [ComfyUI](https://github.com/comfyanonymous/ComfyUI) 的生成参数字段：

   ```js
   exifColumns.push_back(GetColumnMap('PNG', 'Parameters', '', '', '', '', '', ''));
   exifColumns.push_back(GetColumnMap('PNG', 'ComfyScript', '', '', '', '', '', ''));
   exifColumns.push_back(GetColumnMap('PNG', 'ComfyScriptSource', '', '', '', '', '', ''));
   exifColumns.push_back(GetColumnMap('PNG', 'Prompt', '', '', '', '', '', ''));
   ```

   ![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-15fbcdaf836e6922b97a6d62e9170a48ed7a2e2f%2FPNG-Edit.png?alt=media)

   也可打开 `/dopusdata/Script AddIns/ColumnExifTool.js` 进行编辑。
6. 此时即可通过添加列来查看相应字段：

   ![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-7d23f0da83101c6aa9743ba66643886b9538bdca%2FPNG-%E5%88%97.png?alt=media)
7. 也可以在 PNG 类型的信息提示中添加相应字段，例如：

   ```html
   {name}
   {desc}{thumbnail}
    
   <b>大小:</b>\	{sizeauto}
   <b>大小:</b>\	{picsize}
   <b>修改日期:</b>\	{modified}
   <b>Parameters:</b>\	{scp:ExifTool/PNG-Parameters}
   <b>ComfyScript:</b>\	{scp:ExifTool/PNG-ComfyScript}
   ```

   ![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-dc12f8c554c4a425795cc1cf5fa4cf769c426f9a%2FPNG-%E4%BF%A1%E6%81%AF%E6%8F%90%E7%A4%BA.png?alt=media)

   ![](https://3597805814-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3XSZSwWow0fDf6fQJobd%2Fuploads%2Fgit-blob-e6490775d547bd96956ac68b3ae8f156b8171dcc%2FPNG-%E4%BF%A1%E6%81%AF%E6%8F%90%E7%A4%BA2.png?alt=media)

需要注意的是，`ExifTool Custom Columns` 会在读取一张图片时自动读取并缓存当前文件夹的所有图片；多行字段会被折叠为一行；通过信息提示显示大量文本时可能出现卡顿。
