Skip to content

Latest commit

 

History

History
113 lines (80 loc) · 4.41 KB

README.md

File metadata and controls

113 lines (80 loc) · 4.41 KB

Photocopier

Chrome can't copy animated GIFs. Oh, it copies the images all right—but not as animated GIFs. Try it:

  1. Load up a sweet animated GIF like this.
  2. Copy the image using the right-click menu.
  3. Paste the image into Messages.
  4. Send that message to a friend.
  5. Look foolish.

This extension adds a right-click menu item to "really" copy the image:

And it'll work for regular images too.

Installation

  1. Clone this repo.
  2. Open chrome://extensions.
  3. Enable "Developer mode" using the checkbox at the top of the page.
  4. Click the "Load unpacked extension…" button that appears at the top of the page.
  5. In the file picker that appears, select the "Extension" folder within the cloned repo.
  6. In the Terminal, cd to the cloned repo and run ./Host/install_host.sh.

Why Isn't This on the Chrome Web Store?

To actually copy GIFs, the extension needs the help of a native host, and Chrome doesn't support distributing those through the Web Store.

Usage

  1. Right-click on a GIF.
  2. Click "Really Copy Image".
  3. Wait for an "Image copied!" OS X notification.

There may be a little bit of a delay for the GIF to be processed since the extension has to re-download the GIF (see "How It Works" below).

How It Works

If we compare Safari to Chrome, Safari Does The Right Thing™. That's because Safari represents the image differently than Chrome does. Using Apple's ClipboardViewer app, we can see that Chrome only copies GIFs as flat images (and their URLs, in case you try to paste into a plain-text editor):

But Safari also copies GIFs as RTFD format:

That's the format that's read "as a GIF" by Messages. So, all we have to do is download the image ourself and put it onto the pasteboard as RTFD. (Tip of the hat to the Chameleon project for initially putting me onto this technique.)

How Weird Is This?

Pretty weird. Weird enough that I'm not altogether mad at Chrome for not supporting it. To boot, it seems to be Apple-specific given that only OS X supports RTFD. Being a good Mac citizen's not nothing, though.

The real solution would be for everyone to use the GIF clipboard format but no one does and for it to make a difference, the copying and pasting applications would have to support it. Perhaps when Apple developed Messages, they just took advantage of existing applications' support for RTFD (TextEdit accepts GIF pastes, lolol).

Then again, iOS supports the GIF UT type.

Upgrading

  1. cd to the cloned repo and git pull && ./Host/install_host.sh.
  2. Open chrome://extensions.
  3. Click "Reload" under Photocopier.

Uninstallation

  1. Click the trash can next to Photocopier at chrome://extensions.
  2. cd to the cloned repo and run ./Host/uninstall_host.sh.

Contributions

I don't know what more there is to do here but if you have ideas feel free to submit pull requests or otherwise chime in!

Copyright and License

Photocopier Copyright 2015 Jeffrey Wear.

Photocopier is available under the MIT license. See the LICENSE file for more info.