Avoid copying and pasting images from clipboard

Copying an image to the clipboard and then pasting it into a page's Body box can cause severe problems for your website. The action of pasting the image from the clipboard inserts it into the code with a very long string of letters and numbers as its URL source, instead of a real URL.

Chrome and Internet Explorer prevent this action, but Firefox allows it.

  1. If you suspect that you may have copied-and-pasted an image or see image URLs like "data:image..." while you are editing, please delete the image(s) BEFORE you save the page.
    This is what you would see under image properties:
    Under Image Properties, any image URL starting with data:image is a problem.
    In the Body box, click the image to select it, then hit the Delete key to remove it.
    Click the image to select it, then hit the Delete key to remove it.
  2. Then re-insert the image following the recommended steps for Adding Images to Your Pages.

What's the worst that can happen?

After pasting an image from the clipboard, while you are editing the page, the editor is able to display the image based on that "data:image..." string of code, but when the page is saved, either the length or the content of that string may cause a problem in your site's database. One or more of Drupal's processes may parse through it and fail, resulting in errors that can cripple your site. For example, the page with the pasted-in image occurred may display a white screen with the error message "PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away..."

If this occurs, please contact the SCLS Help Desk immediately. The site will be rolled back to the most recent backup before the image was added. This may result in the loss of changes performed since the backup was made, but it will allow the site to function correctly again.