Refine behaviour for copying modified images to external applications

Authored by rkflx on May 24 2018, 7:41 PM.

Description

Refine behaviour for copying modified images to external applications

Summary:
In b94861f27a29 copying images for pasting into other applications was
added for cases where only adding the URL to the clipboard was not
enough, e.g. for GIMP. This was done by adding a raster based
representation to the mime data.

However, for modified (e.g. cropped) images, the pasted result would
depend on whether the external application used the original URL
containing the unmodified image, or the updated raster data. This was
confusing for the user, and for example for Dolphin pasting the modified
image was not possible at all.

This patch modifies the mime handling so that pasting the modified image

  • works in Dolphin
  • does not require extra steps in LibreOffice
  • is disabled for applications only supporting handling of the unmodified URL (i.e. users have to save the image first)

Test Plan:
Press Ctrl+C in Gwenview and paste to the target for every combination of:

  • Source: JPG, PNG, NEF, SVG
  • Regular and Cropped copy for every source file format
  • Target: Dolphin, GIMP, LibreOffice, Inkscape, Firefox, Kate

Copying and pasting non-image files and multiple images should work as before and produce no warnings.

Reviewers: Gwenview, muhlenpfordt

Reviewed By: Gwenview, muhlenpfordt

Subscribers: muhlenpfordt

Differential Revision: https://phabricator.kde.org/D13028

Details