[Spice-devel] [vdagent-win PATCH v8 0/5] Rewrite image support

Frediano Ziglio fziglio at redhat.com
Wed Jul 19 08:42:38 UTC 2017


CxImage is used for image conversion for clipboard support.
CxImage have currently some issue:
- library is old and unsupported;
- required an old libpng library.
Currently the MingW binary we distribute due to some
issue have PNG disabled (so no clipboard image support).
Note that currently we support (before and after this patch)
only BMP and PNG. PNG is required as the default agent format.
However Windows programs wants to have BMP (specifically DIB)
in the clipboard.
This patch remove CxImage and use directly libpng (BMP is
supported directly by Windows APIs).
Tested with various formats and the compiled agent with a
Linux client.
The main concern is actually the possible problem to
support some weird/old BMP file formats however I don't
think any actual program will handle BMP2 (BMP3 was
introduced with Windows 3 probably 30 years ago).

The test patch add a test helper executable and a script
to test PNG encoding.

Changes since v7:
- use png_set_bgr to avoid manually swap pixel components;
- use "unsigned int" instead of unsigned;
- use png_error instead of a manual longjmp;
- moved some code hunks in early patches;
- minor style changes.

Changes since v6:
- minor style changes;
- merge small change to imagetest from Uri (usage error).

Changes since v5:
- remove jpeg dependencies, were used just to satisfy
  CxImage but not used in the code.

Changes since v4:
- remove tiff dependency, was just for CxImage.

Changes since v3:
- reuse code to compute DIB stride;
- update documentation comments;
- update copyright lines.

Changes since v2:
- updated copyright lines;
- update some function documentation;
- fixed 2 bit PNGs;
- removed RFC from tests;
- improved test adding different images;
- merged Uri fix for memory.

Frediano Ziglio (5):
  Move image handling to a separate file
  Initial rewrite of image conversion code
  Write code to decode PNG format
  Support encoding PNG images
  Add test for PNG files

 Makefile.am                 |  28 +++-
 configure.ac                |   5 +-
 mingw-spice-vdagent.spec.in |  10 +-
 test-png                    |  50 +++++++
 vdagent/image.cpp           | 174 +++++++++++++++++++++++
 vdagent/image.h             |  69 +++++++++
 vdagent/imagepng.cpp        | 339 ++++++++++++++++++++++++++++++++++++++++++++
 vdagent/imagepng.h          |  25 ++++
 vdagent/imagetest.cpp       |  82 +++++++++++
 vdagent/vdagent.cpp         |  57 ++------
 10 files changed, 778 insertions(+), 61 deletions(-)
 create mode 100755 test-png
 create mode 100644 vdagent/image.cpp
 create mode 100644 vdagent/image.h
 create mode 100644 vdagent/imagepng.cpp
 create mode 100644 vdagent/imagepng.h
 create mode 100644 vdagent/imagetest.cpp

-- 
2.13.3



More information about the Spice-devel mailing list