Commit Graph

866 Commits

Author SHA1 Message Date
Dmitry Timoshkov 6e7a2bd349 windowscodecs/tests: Add some tests for converting 24bppBGR to 8bppIndexed format.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 17:47:40 +01:00
Dmitry Timoshkov 4883556add windowscodecs/tests: Add a bunch of new tests for indexed format conversions.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 17:47:38 +01:00
Dmitry Timoshkov 312cd7b588 windowscodecs: Fix behaviour of format converter for indexed formats when NULL or empty palette has been provided.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 17:47:36 +01:00
Dmitry Timoshkov 603ac6ad21 windowscodecs: WICConvertBitmapSource should ask IWICFormatConverter::Initialize to use an optimized palette.
This matches Windows' behaviour, and makes a simple test application that
converts any WIC compatible RGB(A) source image to 8bppIndexed format work.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 17:47:32 +01:00
Dmitry Timoshkov 453aa45980 windowscodecs: Add a NULL check to 8bpp gray converter.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-04 15:26:29 +01:00
Dmitry Timoshkov d6c2734d72 windowscodecs: Add support for converting to 8bppIndexed format.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-04 15:26:25 +01:00
Michael Stefaniuc eb271ec4ba windowscodecs: Remove redundant NULL check before HeapFree().
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-31 18:13:18 +01:00
Michael Stefaniuc 52066ee092 windowscodecs: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-31 18:13:18 +01:00
Dmitry Timoshkov d102d6e9f7 windowscodecs: Implement IWICPalette::InitializeFromBitmap.
Based on median cut implementation created by Sebastian Lackner.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-31 18:13:18 +01:00
Sven Baars 1f132865ec windowscodecs: Fix a memory leak (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-25 10:28:58 +01:00
Dmitry Timoshkov 7ee553f411 windowscodecs: Fix the buffer size check in TIFF decoder's CopyPixels implementation.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-15 16:59:03 +01:00
Dmitry Timoshkov ebe15537d1 windowscodecs/tests: Fix typos in TIFF test data.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-10 10:03:32 -06:00
Dmitry Timoshkov 3887c04f43 windowscodecs: Simplify the buffer size check in copy_pixels() helper.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-10 10:03:20 -06:00
Dmitry Timoshkov 8cdef63178 windowscodecs/tests: Add a test for copying pixels of a 24bpp TIFF format.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-09 09:58:12 -06:00
Andrey Gusev af8d3d366c windowscodecs: Remove redundant comparison.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-21 14:02:33 +01:00
Sven Baars a77c7626dd windowscodecs/tests: Fix a memory leak (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-19 22:12:04 +01:00
Sven Baars 7a32035fc5 windowscodecs: Fix a memory leak (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-19 22:12:03 +01:00
Dmitry Timoshkov 2407a7477f windowscodecs/tests: Add some tests for IWICPalette::InitializeFromBitmap.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:42:19 +01:00
Dmitry Timoshkov b9bb512018 windowscodecs: Implement IWICBitmapDecoder::GetMetadataQueryReader in the JPEG encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:42:14 +01:00
Dmitry Timoshkov b4c3a9c089 windowscodecs: Implement IWICBitmapDecoder::GetMetadataQueryReader in the PNG decoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:42:13 +01:00
Dmitry Timoshkov 849807c973 windowscodecs: Implement IWICBitmapDecoder::GetMetadataQueryReader in the TIFF decoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:42:11 +01:00
Dmitry Timoshkov a4a5c38089 windowscodecs: Add registration for GUID_WICPixelFormat32bppGrayFloat pixel format.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-07 16:42:09 +01:00
Dmitry Timoshkov 38b222c662 windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in PNG encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:59 +01:00
Dmitry Timoshkov d88eb99e57 windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in TIFF encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:55 +01:00
Dmitry Timoshkov c2451240dc windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in JPEG encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:50 +01:00
Dmitry Timoshkov e246dd46ec windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in BMP encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:42 +01:00
Dmitry Timoshkov 7533f251e3 windowscodecs: Implement IWICBitmapEncoderInfo::GetFileExtensions.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:33 +01:00
Dmitry Timoshkov ee6dd81e92 windowscodecs: Add support for palette image formats to BMP encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:26 +01:00
Dmitry Timoshkov d13d34d101 windowscodecs: Add support for palette image formats to TIFF encoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 17:00:09 +01:00
Dmitry Timoshkov 1d7da01ff1 windowscodecs/tests: Add tests for encoding 2bpp/4bpp images with a palette.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-06 16:59:49 +01:00
Alex Henrie 5b9dbd9242 windowscodecs: Make constant 'valuename_format' static.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:42 +01:00
Dmitry Timoshkov d90047ed91 windowscodecs: PNG decoder should return WINCODEC_ERR_UNKNOWNIMAGEFORMAT when image loading fails.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:42 +01:00
Dmitry Timoshkov 957d1097d2 windowscodecs: find_decoder() should return an error it received from the decoder.
If IWICBitmapDecoderInfo::MatchesPattern() has recognized the decoder by the pattern,
and the called IWICBitmapDecoder::Initialize() has failed, an error should be returned
right away instead of trying next codec. This allows report image format related errors
instead of WINCODEC_ERR_COMPONENTNOTFOUND.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:42 +01:00
Dmitry Timoshkov 5a4f5ce8b4 windowscodecs: Limit number of colors in a palette in BMP decoder.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:42 +01:00
Dmitry Timoshkov 0b428f8819 windowscodecs: Use V_UI1() instead of V_UNION() to assign a VT_UI1 variant member.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:42 +01:00
Nikolay Sivov 6704ef1430 windowscodecs: Fix InitializeFromIStream() to simply wrap target stream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:39 +01:00
Nikolay Sivov fc780fe313 windowscodecs: Trace stream methods arguments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:36 +01:00
Nikolay Sivov 3ad1750e45 windowscodecs/tests: Add more stream tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:33 +01:00
Nikolay Sivov 938d00cd76 windowscodecs: Implement GetContainerFormat() for encoders.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:29 +01:00
Nikolay Sivov 8d75d949a6 windowscodecs: Fix return values for scaler's CopyPalette().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 23:27:26 +01:00
Nikolay Sivov fc2b2b1bd4 wincodecs: Grab TIFF decoder reference when creating frames.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 10:43:37 +01:00
Nikolay Sivov f92cfb31d2 wincodecs: Fix return value for scaler GetResolution().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:54:28 +01:00
Nikolay Sivov 85d6be3e9e wincodecs: Fix scaler return pixel format for uninitialized case.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:54:28 +01:00
Nikolay Sivov 5976988b1e wincodecs: Trace WICRect arguments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:54:28 +01:00
Nikolay Sivov 9556419d7c wincodecs: Fix failure paths in scaler's GetSize().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:54:28 +01:00
Nikolay Sivov 85a216648c wincodecs: Fix parameter validation during scaler initialization.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:54:28 +01:00
Nikolay Sivov 70a3e86997 wincodecs: Add support for WICBitmapNoCache in CreateBitmapFromSource() for bitmap as a source.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-08 18:55:22 +01:00
Nikolay Sivov e26e3da6cd wincodecs: Implement CreateBitmapFromSourceRect().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-08 18:55:20 +01:00
Akihiro Sagawa e93495d3f8 windowscodecs: Fix buffer overflow when generating a palette.
This typically happens when loading 16-bpp color-keyed grayscale PNG
image via GDIPlus.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-05 20:23:42 +01:00
Akihiro Sagawa 495aac5f66 windowscodecs/tests: Introduce PNG_COLOR_TYPE constants.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-05 20:23:33 +01:00