Clipboard.paste image type

From MozillaZine Knowledge Base
Jump to navigationJump to search

Background

This preference affects how images from the clipboard are pasted into the mail/news composition window using HTML mode (Thunderbird, SeaMonkey), or the HTML Composer (SeaMonkey). Rather than specifying a fixed encoding type, the order in which the clipboard contents are tested is determined. Thus, if the image is available in multiple formats, the first encoding type is selected.

Possible values and their effects

0

Prefer JPEG over PNG over GIF:

  1. If JPEG is available, paste in JPEG format;
  2. if JPEG is not available but PNG, paste in PNG;
  3. if neither JPEG nor PNG are available, but GIF, paste in GIF.

1

Prefer PNG over JPEG over GIF (this is the default):

  1. If PNG is available, paste in PNG format;
  2. if PNG is not available but JPEG, paste in JPEG;
  3. if neither PNG nor JPEG are available, but GIF, paste in GIF.

2

Prefer GIF over JPEG over PNG:

  1. If GIF is available, paste in GIF format;
  2. if GIF is not available but JPEG, paste in JPEG;
  3. if neither GIF nor JPEG are available, but PNG, paste in PNG.

Caveats

  • Not all clipboard mechanisms support the GIF format, thus setting this preference to "2" usually results in pasting JPEG instead (e.g., on Windows and Linux).
  • The original format the image was copied from should not have any impact in which format it is pasted to. Thus, if you open a JPEG image in a viewer, then copy-paste it, it may nevertheless be recoded to PNG if this preference is on its default "1" (e.g., Windows is using an intermediate CF_DIB format on the clipboard, thus the image is explicitly decoded from JPEG first and then encoded into PNG or JPEG, depending on this setting).
  • This preference does not have any influence on images inserted by drag-and-drop from web pages or files, those retain their original encoding as only a reference to the original is pasted rather than the image itself.

First checked in

2008-07-12 (for Editor part), 2008-10-20 (Windows Widgets).

Has an effect in

  • Thunderbird, trunk builds since 2008-07-25 (non-Windows 3.0a3, Windows 3.0b1 and later)
  • SeaMonkey, trunk builds since 2008-07-22 (non-Windows 2.0a1, Windows 2.0a2 and later)

Related bugs