diff options
67 files changed, 265 insertions, 201 deletions
diff --git a/.qmake.conf b/.qmake.conf index 35dba54..b3c7403 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.14.2 +MODULE_VERSION = 5.15.0 diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0 new file mode 100644 index 0000000..2e8a036 --- /dev/null +++ b/dist/changes-5.15.0 @@ -0,0 +1,28 @@ +Qt 5.15 introduces many new features and improvements as well as bugfixes +over the 5.14.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.15 series is binary compatible with the 5.14.x series. +Applications compiled for 5.14 will continue to run with 5.15. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* TIFF * +**************************************************************************** + + - Add support for reading BigTIFF + +**************************************************************************** +* Third-Party Code * +**************************************************************************** + + - Update bundled libwebp to version 1.1.0 diff --git a/src/3rdparty/libwebp/AUTHORS b/src/3rdparty/libwebp/AUTHORS index 67482c1..32ff2fb 100644 --- a/src/3rdparty/libwebp/AUTHORS +++ b/src/3rdparty/libwebp/AUTHORS @@ -2,6 +2,7 @@ Contributors: - Aidan O'Loan (aidanol at gmail dot com) - Alan Browning (browning at google dot com) - Charles Munger (clm at google dot com) +- Cheng Yi (cyi at google dot com) - Christian Duvivier (cduvivier at google dot com) - Djordje Pesut (djordje dot pesut at imgtec dot com) - Hui Su (huisu at google dot com) @@ -21,6 +22,7 @@ Contributors: - Mislav Bradac (mislavm at google dot com) - Nico Weber (thakis at chromium dot org) - Noel Chromium (noel at chromium dot org) +- Oliver Wolff (oliver dot wolff at qt dot io) - Owen Rodley (orodley at google dot com) - Parag Salasakar (img dot mips1 at gmail dot com) - Pascal Massimino (pascal dot massimino at gmail dot com) diff --git a/src/3rdparty/libwebp/ChangeLog b/src/3rdparty/libwebp/ChangeLog index 10ba580..0a286fc 100644 --- a/src/3rdparty/libwebp/ChangeLog +++ b/src/3rdparty/libwebp/ChangeLog @@ -1,3 +1,31 @@ +7f006436 Makefile.vc: fix webp_quality.exe link +c074c653 update NEWS +30f09551 bump version to 1.1.0 +a76694a1 update AUTHORS +6e3ef7b3 extras: fix WEBP_SWAP_16BIT_CSP check +47178dbd extras: add WebPUnmultiplyARGB() convenience function +22cbae33 idec_dec: fix 0 offset of NULL pointer +290dd0b4 muxread: fix 0 offset of NULL pointer +0df474ac Merge "lossless_(enc_|)sse2: avoid offsetting a NULL pointer" +c6b75a19 lossless_(enc_|)sse2: avoid offsetting a NULL pointer +295e5e38 fix UBSAN warning +e2575e05 DC8_NEON,aarch64: use vaddv +b0e09e34 dec_neon: Fix build failure under some toolchains +cf0e903c dsp/lossless: Fix non gcc ARM builds +bb7bc40b Remove ubsan errors. +78881b76 CMake: fix GLUT library link +9f750f7a cmake: fix BUILD_SHARED_LIBS build on mac +17850e74 libwebp: Remove char-subscripts warning in pnmdec.c +2fa2552d Merge "Expose WebPMalloc() in addition to WebPFree()" +a4df4aae Expose WebPMalloc() in addition to WebPFree() +853ea3d8 imageio/tiff: Return error before allocating bad tile size +af650c0b Fix a Wxor-used-as-pow false positive +601ef17c libwebp.py: update to swig 3.0.12 +0e48d889 bugfix: last alpha rows were incorrectly decoded +24d2ccb4 webp: Fix imageio ReadPNM() TUPLTYPE +fab8f9cf cosmetics: normalize '*' association +94138e0e update .gitignore +0fe1a89d update ChangeLog (tag: v1.0.3-rc1, tag: v1.0.3) 2ad0916d update NEWS 1287362b bump version to 1.0.3 7b968cc2 update AUTHORS diff --git a/src/3rdparty/libwebp/NEWS b/src/3rdparty/libwebp/NEWS index 5c0fc8c..46daa09 100644 --- a/src/3rdparty/libwebp/NEWS +++ b/src/3rdparty/libwebp/NEWS @@ -1,3 +1,14 @@ +- 12/18/2019: version 1.1.0 + * API changes: + - libwebp: + WebPMalloc (issue #442) + - extras: + WebPUnmultiplyARGB + * alpha decode fix (issue #439) + * toolchain updates and bug fixes + (chromium: #1026858, #1027136, #1027409, #1028620, #1028716, #995200) + (oss-fuzz: #19430, #19447) + - 7/4/2019: version 1.0.3 This is a binary compatible release. * resize fixes for Nx1 sizes and the addition of non-opaque alpha values for diff --git a/src/3rdparty/libwebp/README b/src/3rdparty/libwebp/README index 60da8a2..0592727 100644 --- a/src/3rdparty/libwebp/README +++ b/src/3rdparty/libwebp/README @@ -4,7 +4,7 @@ \__\__/\____/\_____/__/ ____ ___ / _/ / \ \ / _ \/ _/ / \_/ / / \ \ __/ \__ - \____/____/\_____/_____/____/v1.0.3 + \____/____/\_____/_____/____/v1.1.0 Description: ============ diff --git a/src/3rdparty/libwebp/qt_attribution.json b/src/3rdparty/libwebp/qt_attribution.json index 8d15db5..618c31c 100644 --- a/src/3rdparty/libwebp/qt_attribution.json +++ b/src/3rdparty/libwebp/qt_attribution.json @@ -6,7 +6,7 @@ "Description": "WebP is a new image format that provides lossless and lossy compression for images on the web.", "Homepage": "https://developers.google.com/speed/webp/", - "Version": "1.0.3", + "Version": "1.1.0", "License": "BSD 3-clause \"New\" or \"Revised\" License", "LicenseId": "BSD-3-Clause", "LicenseFile": "COPYING", diff --git a/src/3rdparty/libwebp/src/dec/frame_dec.c b/src/3rdparty/libwebp/src/dec/frame_dec.c index bda9e1a..04609a8 100644 --- a/src/3rdparty/libwebp/src/dec/frame_dec.c +++ b/src/3rdparty/libwebp/src/dec/frame_dec.c @@ -732,7 +732,7 @@ static int AllocateMemory(VP8Decoder* const dec) { mem += f_info_size; dec->thread_ctx_.id_ = 0; dec->thread_ctx_.f_info_ = dec->f_info_; - if (dec->mt_method_ > 0) { + if (dec->filter_type_ > 0 && dec->mt_method_ > 0) { // secondary cache line. The deblocking process need to make use of the // filtering strength from previous macroblock row, while the new ones // are being decoded in parallel. We'll just swap the pointers. diff --git a/src/3rdparty/libwebp/src/dec/idec_dec.c b/src/3rdparty/libwebp/src/dec/idec_dec.c index 9bc9166..9035df5 100644 --- a/src/3rdparty/libwebp/src/dec/idec_dec.c +++ b/src/3rdparty/libwebp/src/dec/idec_dec.c @@ -166,9 +166,11 @@ static int AppendToMemBuffer(WebPIDecoder* const idec, VP8Decoder* const dec = (VP8Decoder*)idec->dec_; MemBuffer* const mem = &idec->mem_; const int need_compressed_alpha = NeedCompressedAlpha(idec); - const uint8_t* const old_start = mem->buf_ + mem->start_; + const uint8_t* const old_start = + (mem->buf_ == NULL) ? NULL : mem->buf_ + mem->start_; const uint8_t* const old_base = need_compressed_alpha ? dec->alpha_data_ : old_start; + assert(mem->buf_ != NULL || mem->start_ == 0); assert(mem->mode_ == MEM_MODE_APPEND); if (data_size > MAX_CHUNK_PAYLOAD) { // security safeguard: trying to allocate more than what the format @@ -184,7 +186,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec, uint8_t* const new_buf = (uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf)); if (new_buf == NULL) return 0; - memcpy(new_buf, old_base, current_size); + if (old_base != NULL) memcpy(new_buf, old_base, current_size); WebPSafeFree(mem->buf_); mem->buf_ = new_buf; mem->buf_size_ = (size_t)extra_size; @@ -192,6 +194,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec, mem->end_ = current_size; } + assert(mem->buf_ != NULL); memcpy(mem->buf_ + mem->end_, data, data_size); mem->end_ += data_size; assert(mem->end_ <= mem->buf_size_); @@ -204,7 +207,9 @@ static int RemapMemBuffer(WebPIDecoder* const idec, const uint8_t* const data, size_t data_size) { MemBuffer* const mem = &idec->mem_; const uint8_t* const old_buf = mem->buf_; - const uint8_t* const old_start = old_buf + mem->start_; + const uint8_t* const old_start = + (old_buf == NULL) ? NULL : old_buf + mem->start_; + assert(old_buf != NULL || mem->start_ == 0); assert(mem->mode_ == MEM_MODE_MAP); if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer! diff --git a/src/3rdparty/libwebp/src/dec/vp8i_dec.h b/src/3rdparty/libwebp/src/dec/vp8i_dec.h index 3de8d86..600a684 100644 --- a/src/3rdparty/libwebp/src/dec/vp8i_dec.h +++ b/src/3rdparty/libwebp/src/dec/vp8i_dec.h @@ -31,8 +31,8 @@ extern "C" { // version numbers #define DEC_MAJ_VERSION 1 -#define DEC_MIN_VERSION 0 -#define DEC_REV_VERSION 3 +#define DEC_MIN_VERSION 1 +#define DEC_REV_VERSION 0 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). // Constraints are: We need to store one 16x16 block of luma samples (y), diff --git a/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/src/3rdparty/libwebp/src/dec/vp8l_dec.c index d3e2711..93615d4 100644 --- a/src/3rdparty/libwebp/src/dec/vp8l_dec.c +++ b/src/3rdparty/libwebp/src/dec/vp8l_dec.c @@ -754,11 +754,11 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr, typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row); -static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows, +static void ApplyInverseTransforms(VP8LDecoder* const dec, + int start_row, int num_rows, const uint32_t* const rows) { int n = dec->next_transform_; const int cache_pixs = dec->width_ * num_rows; - const int start_row = dec->last_row_; const int end_row = start_row + num_rows; const uint32_t* rows_in = rows; uint32_t* const rows_out = dec->argb_cache_; @@ -789,8 +789,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) { VP8Io* const io = dec->io_; uint8_t* rows_data = (uint8_t*)dec->argb_cache_; const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA - - ApplyInverseTransforms(dec, num_rows, rows); + ApplyInverseTransforms(dec, dec->last_row_, num_rows, rows); if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) { // Nothing to output (this time). } else { @@ -1193,6 +1192,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data, VP8LFillBitWindow(br); dist_code = GetCopyDistance(dist_symbol, br); dist = PlaneCodeToDistance(width, dist_code); + if (VP8LIsEndOfStream(br)) break; if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) { goto Error; @@ -1553,7 +1553,7 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) { const int cache_pixs = width * num_rows_to_process; uint8_t* const dst = output + width * cur_row; const uint32_t* const src = dec->argb_cache_; - ApplyInverseTransforms(dec, num_rows_to_process, in); + ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in); WebPExtractGreen(src, dst, cache_pixs); AlphaApplyFilter(alph_dec, cur_row, cur_row + num_rows_to_process, dst, width); diff --git a/src/3rdparty/libwebp/src/dec/vp8li_dec.h b/src/3rdparty/libwebp/src/dec/vp8li_dec.h index 0a4d613..72b2e86 100644 --- a/src/3rdparty/libwebp/src/dec/vp8li_dec.h +++ b/src/3rdparty/libwebp/src/dec/vp8li_dec.h @@ -37,7 +37,7 @@ struct VP8LTransform { int bits_; // subsampling bits defining transform window. int xsize_; // transform window X index. int ysize_; // transform window Y index. - uint32_t *data_; // transform data. + uint32_t* data_; // transform data. }; typedef struct { @@ -48,23 +48,23 @@ typedef struct { int huffman_mask_; int huffman_subsample_bits_; int huffman_xsize_; - uint32_t *huffman_image_; + uint32_t* huffman_image_; int num_htree_groups_; - HTreeGroup *htree_groups_; - HuffmanCode *huffman_tables_; + HTreeGroup* htree_groups_; + HuffmanCode* huffman_tables_; } VP8LMetadata; typedef struct VP8LDecoder VP8LDecoder; struct VP8LDecoder { VP8StatusCode status_; VP8LDecodeState state_; - VP8Io *io_; + VP8Io* io_; - const WebPDecBuffer *output_; // shortcut to io->opaque->output + const WebPDecBuffer* output_; // shortcut to io->opaque->output - uint32_t *pixels_; // Internal data: either uint8_t* for alpha + uint32_t* pixels_; // Internal data: either uint8_t* for alpha // or uint32_t* for BGRA. - uint32_t *argb_cache_; // Scratch buffer for temporary BGRA storage. + uint32_t* argb_cache_; // Scratch buffer for temporary BGRA storage. VP8LBitReader br_; int incremental_; // if true, incremental decoding is expected @@ -86,8 +86,8 @@ struct VP8LDecoder { // or'd bitset storing the transforms types. uint32_t transforms_seen_; - uint8_t *rescaler_memory; // Working memory for rescaling work. - WebPRescaler *rescaler; // Common rescaler for all channels. + uint8_t* rescaler_memory; // Working memory for rescaling work. + WebPRescaler* rescaler; // Common rescaler for all channels. }; //------------------------------------------------------------------------------ diff --git a/src/3rdparty/libwebp/src/demux/demux.c b/src/3rdparty/libwebp/src/demux/demux.c index ab6433e..1b3cc2e 100644 --- a/src/3rdparty/libwebp/src/demux/demux.c +++ b/src/3rdparty/libwebp/src/demux/demux.c @@ -24,8 +24,8 @@ #include "src/webp/format_constants.h" #define DMUX_MAJ_VERSION 1 -#define DMUX_MIN_VERSION 0 -#define DMUX_REV_VERSION 3 +#define DMUX_MIN_VERSION 1 +#define DMUX_REV_VERSION 0 typedef struct { size_t start_; // start location of the data diff --git a/src/3rdparty/libwebp/src/dsp/dec_neon.c b/src/3rdparty/libwebp/src/dsp/dec_neon.c index ffa697f..239ec41 100644 --- a/src/3rdparty/libwebp/src/dsp/dec_neon.c +++ b/src/3rdparty/libwebp/src/dsp/dec_neon.c @@ -1361,7 +1361,8 @@ static void RD4_NEON(uint8_t* dst) { // Down-right const uint32_t J = dst[-1 + 1 * BPS]; const uint32_t K = dst[-1 + 2 * BPS]; const uint32_t L = dst[-1 + 3 * BPS]; - const uint64x1_t LKJI____ = vcreate_u64(L | (K << 8) | (J << 16) | (I << 24)); + const uint64x1_t LKJI____ = + vcreate_u64((uint64_t)L | (K << 8) | (J << 16) | (I << 24)); const uint64x1_t LKJIXABC = vorr_u64(LKJI____, ____XABC); const uint8x8_t KJIXABC_ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 8)); const uint8x8_t JIXABC__ = vreinterpret_u8_u64(vshr_n_u64(LKJIXABC, 16)); @@ -1427,10 +1428,16 @@ static WEBP_INLINE void DC8_NEON(uint8_t* dst, int do_top, int do_left) { if (do_top) { const uint8x8_t A = vld1_u8(dst - BPS); // top row +#if defined(__aarch64__) + const uint16x8_t B = vmovl_u8(A); + const uint16_t p2 = vaddvq_u16(B); + sum_top = vdupq_n_u16(p2); +#else const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top const uint16x4_t p1 = vpadd_u16(p0, p0); const uint16x4_t p2 = vpadd_u16(p1, p1); sum_top = vcombine_u16(p2, p2); +#endif } if (do_left) { diff --git a/src/3rdparty/libwebp/src/dsp/dsp.h b/src/3rdparty/libwebp/src/dsp/dsp.h index 0d7f3fb..7c75b26 100644 --- a/src/3rdparty/libwebp/src/dsp/dsp.h +++ b/src/3rdparty/libwebp/src/dsp/dsp.h @@ -246,9 +246,9 @@ extern VP8Fdct VP8FTransform2; // performs two transforms at a time extern VP8WHT VP8FTransformWHT; // Predictions // *dst is the destination block. *top and *left can be NULL. -typedef void (*VP8IntraPreds)(uint8_t *dst, const uint8_t* left, +typedef void (*VP8IntraPreds)(uint8_t* dst, const uint8_t* left, const uint8_t* top); -typedef void (*VP8Intra4Preds)(uint8_t *dst, const uint8_t* top); +typedef void (*VP8Intra4Preds)(uint8_t* dst, const uint8_t* top); extern VP8Intra4Preds VP8EncPredLuma4; extern VP8IntraPreds VP8EncPredLuma16; extern VP8IntraPreds VP8EncPredChroma8; diff --git a/src/3rdparty/libwebp/src/dsp/lossless.c b/src/3rdparty/libwebp/src/dsp/lossless.c index d05af84..aad5f43 100644 --- a/src/3rdparty/libwebp/src/dsp/lossless.c +++ b/src/3rdparty/libwebp/src/dsp/lossless.c @@ -81,7 +81,7 @@ static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, // gcc <= 4.9 on ARM generates incorrect code in Select() when Sub3() is // inlined. -#if defined(__arm__) && LOCAL_GCC_VERSION <= 0x409 +#if defined(__arm__) && defined(__GNUC__) && LOCAL_GCC_VERSION <= 0x409 # define LOCAL_INLINE __attribute__ ((noinline)) #else # define LOCAL_INLINE WEBP_INLINE @@ -167,15 +167,20 @@ static uint32_t Predictor13_C(uint32_t left, const uint32_t* const top) { return pred; } -GENERATE_PREDICTOR_ADD(Predictor0_C, PredictorAdd0_C) +static void PredictorAdd0_C(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int x; + (void)upper; + for (x = 0; x < num_pixels; ++x) out[x] = VP8LAddPixels(in[x], ARGB_BLACK); +} static void PredictorAdd1_C(const uint32_t* in, const uint32_t* upper, int num_pixels, uint32_t* out) { int i; uint32_t left = out[-1]; + (void)upper; for (i = 0; i < num_pixels; ++i) { out[i] = left = VP8LAddPixels(in[i], left); } - (void)upper; } GENERATE_PREDICTOR_ADD(Predictor2_C, PredictorAdd2_C) GENERATE_PREDICTOR_ADD(Predictor3_C, PredictorAdd3_C) diff --git a/src/3rdparty/libwebp/src/dsp/lossless_common.h b/src/3rdparty/libwebp/src/dsp/lossless_common.h index a2648d1..9c2ebe6 100644 --- a/src/3rdparty/libwebp/src/dsp/lossless_common.h +++ b/src/3rdparty/libwebp/src/dsp/lossless_common.h @@ -177,6 +177,7 @@ uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \ int num_pixels, uint32_t* out) { \ int x; \ + assert(upper != NULL); \ for (x = 0; x < num_pixels; ++x) { \ const uint32_t pred = (PREDICTOR)(out[x - 1], upper + x); \ out[x] = VP8LAddPixels(in[x], pred); \ @@ -189,6 +190,7 @@ static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \ static void PREDICTOR_SUB(const uint32_t* in, const uint32_t* upper, \ int num_pixels, uint32_t* out) { \ int x; \ + assert(upper != NULL); \ for (x = 0; x < num_pixels; ++x) { \ const uint32_t pred = (PREDICTOR)(in[x - 1], upper + x); \ out[x] = VP8LSubPixels(in[x], pred); \ diff --git a/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c b/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c index 8adc521..e676f6f 100644 --- a/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c +++ b/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c @@ -455,8 +455,9 @@ static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper, _mm_storeu_si128((__m128i*)&out[i], res); } if (i != num_pixels) { - VP8LPredictorsSub_C[0](in + i, upper + i, num_pixels - i, out + i); + VP8LPredictorsSub_C[0](in + i, NULL, num_pixels - i, out + i); } + (void)upper; } #define GENERATE_PREDICTOR_1(X, IN) \ diff --git a/src/3rdparty/libwebp/src/dsp/lossless_sse2.c b/src/3rdparty/libwebp/src/dsp/lossless_sse2.c index 17d7576..aef0cee 100644 --- a/src/3rdparty/libwebp/src/dsp/lossless_sse2.c +++ b/src/3rdparty/libwebp/src/dsp/lossless_sse2.c @@ -191,8 +191,9 @@ static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper, _mm_storeu_si128((__m128i*)&out[i], res); } if (i != num_pixels) { - VP8LPredictorsAdd_C[0](in + i, upper + i, num_pixels - i, out + i); + VP8LPredictorsAdd_C[0](in + i, NULL, num_pixels - i, out + i); } + (void)upper; } // Predictor1: left. diff --git a/src/3rdparty/libwebp/src/dsp/upsampling_msa.c b/src/3rdparty/libwebp/src/dsp/upsampling_msa.c index 99eea70..f2e03e8 100644 --- a/src/3rdparty/libwebp/src/dsp/upsampling_msa.c +++ b/src/3rdparty/libwebp/src/dsp/upsampling_msa.c @@ -576,9 +576,9 @@ static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bot_y, \ const uint32_t l_uv = ((cur_u[0]) | ((cur_v[0]) << 16)); \ const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ const uint8_t* ptop_y = &top_y[1]; \ - uint8_t *ptop_dst = top_dst + XSTEP; \ + uint8_t* ptop_dst = top_dst + XSTEP; \ const uint8_t* pbot_y = &bot_y[1]; \ - uint8_t *pbot_dst = bot_dst + XSTEP; \ + uint8_t* pbot_dst = bot_dst + XSTEP; \ \ FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ if (bot_y != NULL) { \ diff --git a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c b/src/3rdparty/libwebp/src/dsp/upsampling_neon.c index 17cbc9f..6ba71a7 100644 --- a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c +++ b/src/3rdparty/libwebp/src/dsp/upsampling_neon.c @@ -58,8 +58,8 @@ } while (0) // Turn the macro into a function for reducing code-size when non-critical -static void Upsample16Pixels_NEON(const uint8_t *r1, const uint8_t *r2, - uint8_t *out) { +static void Upsample16Pixels_NEON(const uint8_t* r1, const uint8_t* r2, + uint8_t* out) { UPSAMPLE_16PIXELS(r1, r2, out); } @@ -190,14 +190,14 @@ static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 }; } #define NEON_UPSAMPLE_FUNC(FUNC_NAME, FMT, XSTEP) \ -static void FUNC_NAME(const uint8_t *top_y, const uint8_t *bottom_y, \ - const uint8_t *top_u, const uint8_t *top_v, \ - const uint8_t *cur_u, const uint8_t *cur_v, \ - uint8_t *top_dst, uint8_t *bottom_dst, int len) { \ +static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y, \ + const uint8_t* top_u, const uint8_t* top_v, \ + const uint8_t* cur_u, const uint8_t* cur_v, \ + uint8_t* top_dst, uint8_t* bottom_dst, int len) { \ int block; \ /* 16 byte aligned array to cache reconstructed u and v */ \ uint8_t uv_buf[2 * 32 + 15]; \ - uint8_t *const r_uv = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15); \ + uint8_t* const r_uv = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15); \ const int uv_len = (len + 1) >> 1; \ /* 9 pixels must be read-able for each block */ \ const int num_blocks = (uv_len - 1) >> 3; \ diff --git a/src/3rdparty/libwebp/src/enc/histogram_enc.c b/src/3rdparty/libwebp/src/enc/histogram_enc.c index d89b985..a4e6bf3 100644 --- a/src/3rdparty/libwebp/src/enc/histogram_enc.c +++ b/src/3rdparty/libwebp/src/enc/histogram_enc.c @@ -641,7 +641,7 @@ static void HistogramAnalyzeEntropyBin(VP8LHistogramSet* const image_histo, // Merges some histograms with same bin_id together if it's advantageous. // Sets the remaining histograms to NULL. static void HistogramCombineEntropyBin(VP8LHistogramSet* const image_histo, - int *num_used, + int* num_used, const uint16_t* const clusters, uint16_t* const cluster_mappings, VP8LHistogram* cur_combo, diff --git a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c b/src/3rdparty/libwebp/src/enc/picture_csp_enc.c index 02d9df7..718e014 100644 --- a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c +++ b/src/3rdparty/libwebp/src/enc/picture_csp_enc.c @@ -29,11 +29,15 @@ #define USE_INVERSE_ALPHA_TABLE #ifdef WORDS_BIGENDIAN -#define ALPHA_OFFSET 0 // uint32_t 0xff000000 is 0xff,00,00,00 in memory +// uint32_t 0xff000000 is 0xff,00,00,00 in memory +#define CHANNEL_OFFSET(i) (i) #else -#define ALPHA_OFFSET 3 // uint32_t 0xff000000 is 0x00,00,00,ff in memory +// uint32_t 0xff000000 is 0x00,00,00,ff in memory +#define CHANNEL_OFFSET(i) (3-(i)) #endif +#define ALPHA_OFFSET CHANNEL_OFFSET(0) + //------------------------------------------------------------------------------ // Detection of non-trivial transparency @@ -997,10 +1001,10 @@ static int PictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace, return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); } else { const uint8_t* const argb = (const uint8_t*)picture->argb; - const uint8_t* const a = argb + (0 ^ ALPHA_OFFSET); - const uint8_t* const r = argb + (1 ^ ALPHA_OFFSET); - const uint8_t* const g = argb + (2 ^ ALPHA_OFFSET); - const uint8_t* const b = argb + (3 ^ ALPHA_OFFSET); + const uint8_t* const a = argb + CHANNEL_OFFSET(0); + const uint8_t* const r = argb + CHANNEL_OFFSET(1); + const uint8_t* const g = argb + CHANNEL_OFFSET(2); + const uint8_t* const b = argb + CHANNEL_OFFSET(3); picture->colorspace = WEBP_YUV420; return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride, @@ -1050,7 +1054,7 @@ int WebPPictureYUVAToARGB(WebPPicture* picture) { const int height = picture->height; const int argb_stride = 4 * picture->argb_stride; uint8_t* dst = (uint8_t*)picture->argb; - const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; + const uint8_t* cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; WebPUpsampleLinePairFunc upsample = WebPGetLinePairConverter(ALPHA_OFFSET > 0); diff --git a/src/3rdparty/libwebp/src/enc/vp8i_enc.h b/src/3rdparty/libwebp/src/enc/vp8i_enc.h index 24e1944..fedcaee 100644 --- a/src/3rdparty/libwebp/src/enc/vp8i_enc.h +++ b/src/3rdparty/libwebp/src/enc/vp8i_enc.h @@ -31,8 +31,8 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 1 -#define ENC_MIN_VERSION 0 -#define ENC_REV_VERSION 3 +#define ENC_MIN_VERSION 1 +#define ENC_REV_VERSION 0 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost @@ -249,7 +249,7 @@ typedef struct { int percent0_; // saved initial progress percent DError left_derr_; // left error diffusion (u/v) - DError *top_derr_; // top diffusion error - NULL if disabled + DError* top_derr_; // top diffusion error - NULL if disabled uint8_t* y_left_; // left luma samples (addressable from index -1 to 15). uint8_t* u_left_; // left u samples (addressable from index -1 to 7) diff --git a/src/3rdparty/libwebp/src/mux/muxi.h b/src/3rdparty/libwebp/src/mux/muxi.h index 7bc0b07..ad3e1bd 100644 --- a/src/3rdparty/libwebp/src/mux/muxi.h +++ b/src/3rdparty/libwebp/src/mux/muxi.h @@ -28,8 +28,8 @@ extern "C" { // Defines and constants. #define MUX_MAJ_VERSION 1 -#define MUX_MIN_VERSION 0 -#define MUX_REV_VERSION 3 +#define MUX_MIN_VERSION 1 +#define MUX_REV_VERSION 0 // Chunk object. typedef struct WebPChunk WebPChunk; diff --git a/src/3rdparty/libwebp/src/mux/muxread.c b/src/3rdparty/libwebp/src/mux/muxread.c index 268f6ac..ae3b876 100644 --- a/src/3rdparty/libwebp/src/mux/muxread.c +++ b/src/3rdparty/libwebp/src/mux/muxread.c @@ -100,7 +100,7 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, WebPMuxImage* const wpi) { const uint8_t* bytes = chunk->data_.bytes; size_t size = chunk->data_.size; - const uint8_t* const last = bytes + size; + const uint8_t* const last = (bytes == NULL) ? NULL : bytes + size; WebPChunk subchunk; size_t subchunk_size; WebPChunk** unknown_chunk_list = &wpi->unknown_; diff --git a/src/3rdparty/libwebp/src/utils/color_cache_utils.h b/src/3rdparty/libwebp/src/utils/color_cache_utils.h index ec21d51..b45d47c 100644 --- a/src/3rdparty/libwebp/src/utils/color_cache_utils.h +++ b/src/3rdparty/libwebp/src/utils/color_cache_utils.h @@ -26,7 +26,7 @@ extern "C" { // Main color cache struct. typedef struct { - uint32_t *colors_; // color entries + uint32_t* colors_; // color entries int hash_shift_; // Hash shift: 32 - hash_bits_. int hash_bits_; } VP8LColorCache; diff --git a/src/3rdparty/libwebp/src/utils/thread_utils.c b/src/3rdparty/libwebp/src/utils/thread_utils.c index 438296b..4e470e1 100644 --- a/src/3rdparty/libwebp/src/utils/thread_utils.c +++ b/src/3rdparty/libwebp/src/utils/thread_utils.c @@ -73,7 +73,7 @@ typedef struct { #endif static int pthread_create(pthread_t* const thread, const void* attr, - unsigned int (__stdcall *start)(void*), void* arg) { + unsigned int (__stdcall* start)(void*), void* arg) { (void)attr; #ifdef USE_CREATE_THREAD *thread = CreateThread(NULL, /* lpThreadAttributes */ diff --git a/src/3rdparty/libwebp/src/utils/utils.c b/src/3rdparty/libwebp/src/utils/utils.c index 44d5c14..764f752 100644 --- a/src/3rdparty/libwebp/src/utils/utils.c +++ b/src/3rdparty/libwebp/src/utils/utils.c @@ -216,9 +216,14 @@ void WebPSafeFree(void* const ptr) { free(ptr); } -// Public API function. +// Public API functions. + +void* WebPMalloc(size_t size) { + return WebPSafeMalloc(1, size); +} + void WebPFree(void* ptr) { - free(ptr); + WebPSafeFree(ptr); } //------------------------------------------------------------------------------ diff --git a/src/3rdparty/libwebp/src/webp/config.h b/src/3rdparty/libwebp/src/webp/config.h index 80bb1f0..6f5d153 100644 --- a/src/3rdparty/libwebp/src/webp/config.h +++ b/src/3rdparty/libwebp/src/webp/config.h @@ -81,7 +81,7 @@ #define PACKAGE_NAME "libwebp" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libwebp 1.0.3" +#define PACKAGE_STRING "libwebp 1.1.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libwebp" @@ -90,7 +90,7 @@ #define PACKAGE_URL "http://developers.google.com/speed/webp" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0.3" +#define PACKAGE_VERSION "1.1.0" /* Define to necessary symbol if this constant uses a non-standard name on your system. */ @@ -100,7 +100,7 @@ /* #undef STDC_HEADERS */ /* Version number of package */ -#define VERSION "1.0.3" +#define VERSION "1.1.0" /* Enable experimental code */ /* #undef WEBP_EXPERIMENTAL_FEATURES */ diff --git a/src/3rdparty/libwebp/src/webp/decode.h b/src/3rdparty/libwebp/src/webp/decode.h index ae8bfe8..80dd0ef 100644 --- a/src/3rdparty/libwebp/src/webp/decode.h +++ b/src/3rdparty/libwebp/src/webp/decode.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define WEBP_DECODER_ABI_VERSION 0x0208 // MAJOR(8b) + MINOR(8b) +#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) // Note: forward declaring enumerations is not allowed in (strict) C and C++, // the types are left here for reference. @@ -91,9 +91,6 @@ WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, uint8_t** u, uint8_t** v, int* stride, int* uv_stride); -// Releases memory returned by the WebPDecode*() functions above. -WEBP_EXTERN void WebPFree(void* ptr); - // These five functions are variants of the above ones, that decode the image // directly into a pre-allocated buffer 'output_buffer'. The maximum storage // available in this buffer is indicated by 'output_buffer_size'. If this diff --git a/src/3rdparty/libwebp/src/webp/encode.h b/src/3rdparty/libwebp/src/webp/encode.h index 339f881..655166e 100644 --- a/src/3rdparty/libwebp/src/webp/encode.h +++ b/src/3rdparty/libwebp/src/webp/encode.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define WEBP_ENCODER_ABI_VERSION 0x020e // MAJOR(8b) + MINOR(8b) +#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b) // Note: forward declaring enumerations is not allowed in (strict) C and C++, // the types are left here for reference. @@ -79,9 +79,6 @@ WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, int height, int stride, uint8_t** output); -// Releases memory returned by the WebPEncode*() functions above. -WEBP_EXTERN void WebPFree(void* ptr); - //------------------------------------------------------------------------------ // Coding parameters @@ -306,7 +303,7 @@ struct WebPPicture { // YUV input (mostly used for input to lossy compression) WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) - uint8_t *y, *u, *v; // pointers to luma/chroma planes. + uint8_t* y, *u, *v; // pointers to luma/chroma planes. int y_stride, uv_stride; // luma/chroma strides. uint8_t* a; // pointer to the alpha plane int a_stride; // stride of the alpha plane @@ -350,7 +347,7 @@ struct WebPPicture { uint32_t pad3[3]; // padding for later use // Unused for now - uint8_t *pad4, *pad5; + uint8_t* pad4, *pad5; uint32_t pad6[8]; // padding for later use // PRIVATE FIELDS diff --git a/src/3rdparty/libwebp/src/webp/mux.h b/src/3rdparty/libwebp/src/webp/mux.h index 66096a9..7d27489 100644 --- a/src/3rdparty/libwebp/src/webp/mux.h +++ b/src/3rdparty/libwebp/src/webp/mux.h @@ -57,7 +57,7 @@ extern "C" { WebPMuxGetChunk(mux, "ICCP", &icc_profile); // ... (Consume icc_data). WebPMuxDelete(mux); - free(data); + WebPFree(data); */ // Note: forward declaring enumerations is not allowed in (strict) C and C++, @@ -245,7 +245,7 @@ WEBP_EXTERN WebPMuxError WebPMuxPushFrame( WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); // Gets the nth frame from the mux object. -// The content of 'frame->bitstream' is allocated using malloc(), and NOT +// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT // owned by the 'mux' object. It MUST be deallocated by the caller by calling // WebPDataClear(). // nth=0 has a special meaning - last position. @@ -376,10 +376,10 @@ WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, // Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. // This function also validates the mux object. // Note: The content of 'assembled_data' will be ignored and overwritten. -// Also, the content of 'assembled_data' is allocated using malloc(), and NOT -// owned by the 'mux' object. It MUST be deallocated by the caller by calling -// WebPDataClear(). It's always safe to call WebPDataClear() upon return, -// even in case of error. +// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and +// NOT owned by the 'mux' object. It MUST be deallocated by the caller by +// calling WebPDataClear(). It's always safe to call WebPDataClear() upon +// return, even in case of error. // Parameters: // mux - (in/out) object whose chunks are to be assembled // assembled_data - (out) assembled WebP data diff --git a/src/3rdparty/libwebp/src/webp/mux_types.h b/src/3rdparty/libwebp/src/webp/mux_types.h index ceea77d..2fe8195 100644 --- a/src/3rdparty/libwebp/src/webp/mux_types.h +++ b/src/3rdparty/libwebp/src/webp/mux_types.h @@ -14,7 +14,6 @@ #ifndef WEBP_WEBP_MUX_TYPES_H_ #define WEBP_WEBP_MUX_TYPES_H_ -#include <stdlib.h> // free() #include <string.h> // memset() #include "./types.h" @@ -56,6 +55,7 @@ typedef enum WebPMuxAnimBlend { // Data type used to describe 'raw' data, e.g., chunk data // (ICC profile, metadata) and WebP compressed image data. +// 'bytes' memory must be allocated using WebPMalloc() and such. struct WebPData { const uint8_t* bytes; size_t size; @@ -68,11 +68,11 @@ static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { } } -// Clears the contents of the 'webp_data' object by calling free(). Does not -// deallocate the object itself. +// Clears the contents of the 'webp_data' object by calling WebPFree(). +// Does not deallocate the object itself. static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { if (webp_data != NULL) { - free((void*)webp_data->bytes); + WebPFree((void*)webp_data->bytes); WebPDataInit(webp_data); } } @@ -83,7 +83,7 @@ static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { if (src == NULL || dst == NULL) return 0; WebPDataInit(dst); if (src->bytes != NULL && src->size != 0) { - dst->bytes = (uint8_t*)malloc(src->size); + dst->bytes = (uint8_t*)WebPMalloc(src->size); if (dst->bytes == NULL) return 0; memcpy((void*)dst->bytes, src->bytes, src->size); dst->size = src->size; diff --git a/src/3rdparty/libwebp/src/webp/types.h b/src/3rdparty/libwebp/src/webp/types.h index 0ce2622..47f7f2b 100644 --- a/src/3rdparty/libwebp/src/webp/types.h +++ b/src/3rdparty/libwebp/src/webp/types.h @@ -7,7 +7,7 @@ // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // -// Common types +// Common types + memory wrappers // // Author: Skal (pascal.massimino@gmail.com) @@ -49,4 +49,20 @@ typedef long long int int64_t; // Macro to check ABI compatibility (same major revision number) #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) +#ifdef __cplusplus +extern "C" { +#endif + +// Allocates 'size' bytes of memory. Returns NULL upon error. Memory +// must be deallocated by calling WebPFree(). This function is made available +// by the core 'libwebp' library. +WEBP_EXTERN void* WebPMalloc(size_t size); + +// Releases memory returned by the WebPDecode*() functions (from decode.h). +WEBP_EXTERN void WebPFree(void* ptr); + +#ifdef __cplusplus +} // extern "C" +#endif + #endif // WEBP_WEBP_TYPES_H_ diff --git a/src/imageformats/configure.json b/src/imageformats/configure.json index 4718398..5b876c3 100644 --- a/src/imageformats/configure.json +++ b/src/imageformats/configure.json @@ -155,7 +155,7 @@ "webp": { "label": "WEBP", "disable": "input.webp == 'no'", - "condition": "features.imageformatplugin && !(config.winrt && arch.arm)", + "condition": "features.imageformatplugin", "output": [ "privateFeature" ] diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp index 845f9b3..a0ac19b 100644 --- a/src/plugins/imageformats/dds/qddshandler.cpp +++ b/src/plugins/imageformats/dds/qddshandler.cpp @@ -1382,13 +1382,6 @@ QDDSHandler::QDDSHandler() : { } -#if QT_DEPRECATED_SINCE(5, 13) -QByteArray QDDSHandler::name() const -{ - return QByteArrayLiteral("dds"); -} -#endif - bool QDDSHandler::canRead() const { if (m_scanState == ScanNotScanned && !canRead(device())) diff --git a/src/plugins/imageformats/dds/qddshandler.h b/src/plugins/imageformats/dds/qddshandler.h index f4bc888..0c6449a 100644 --- a/src/plugins/imageformats/dds/qddshandler.h +++ b/src/plugins/imageformats/dds/qddshandler.h @@ -53,10 +53,6 @@ class QDDSHandler : public QImageIOHandler public: QDDSHandler(); -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif - bool canRead() const override; bool read(QImage *image) override; bool write(const QImage &image) override; diff --git a/src/plugins/imageformats/icns/main.cpp b/src/plugins/imageformats/icns/main.cpp index 70dd034..6a5af47 100644 --- a/src/plugins/imageformats/icns/main.cpp +++ b/src/plugins/imageformats/icns/main.cpp @@ -60,12 +60,12 @@ QImageIOPlugin::Capabilities QICNSPlugin::capabilities(QIODevice *device, const { if (format == QByteArrayLiteral("icns")) return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device || !device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QICNSHandler::canRead(device)) cap |= CanRead; if (device->isWritable()) diff --git a/src/plugins/imageformats/icns/qicnshandler.cpp b/src/plugins/imageformats/icns/qicnshandler.cpp index 9733ed7..dde783c 100644 --- a/src/plugins/imageformats/icns/qicnshandler.cpp +++ b/src/plugins/imageformats/icns/qicnshandler.cpp @@ -651,13 +651,6 @@ QICNSHandler::QICNSHandler() : { } -#if QT_DEPRECATED_SINCE(5, 13) -QByteArray QICNSHandler::name() const -{ - return QByteArrayLiteral("icns"); -} -#endif - bool QICNSHandler::canRead(QIODevice *device) { if (!device || !device->isReadable()) { diff --git a/src/plugins/imageformats/icns/qicnshandler_p.h b/src/plugins/imageformats/icns/qicnshandler_p.h index b532045..e83d4eb 100644 --- a/src/plugins/imageformats/icns/qicnshandler_p.h +++ b/src/plugins/imageformats/icns/qicnshandler_p.h @@ -132,10 +132,6 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif - bool supportsOption(ImageOption option) const override; QVariant option(ImageOption option) const override; diff --git a/src/plugins/imageformats/jp2/main.cpp b/src/plugins/imageformats/jp2/main.cpp index a1f1281..22368a5 100644 --- a/src/plugins/imageformats/jp2/main.cpp +++ b/src/plugins/imageformats/jp2/main.cpp @@ -64,12 +64,12 @@ QImageIOPlugin::Capabilities QJp2Plugin::capabilities(QIODevice *device, const Q { if (format == "jp2" || format == "j2k") return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QJp2Handler::canRead(device, 0)) cap |= CanRead; if (device->isWritable()) diff --git a/src/plugins/imageformats/jp2/qjp2handler.cpp b/src/plugins/imageformats/jp2/qjp2handler.cpp index ce23480..e9a470c 100644 --- a/src/plugins/imageformats/jp2/qjp2handler.cpp +++ b/src/plugins/imageformats/jp2/qjp2handler.cpp @@ -308,17 +308,6 @@ bool QJp2Handler::supportsOption(ImageOption option) const return (option == Quality || option == SubType); } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - Return the common identifier of the format. - For JPEG 2000 this will return "jp2". - */ -QByteArray QJp2Handler::name() const -{ - return QByteArrayLiteral("jp2"); -} -#endif - /*! Automatic resource handling for a jas_image_t*. */ diff --git a/src/plugins/imageformats/jp2/qjp2handler_p.h b/src/plugins/imageformats/jp2/qjp2handler_p.h index 16ddc8a..bdaf601 100644 --- a/src/plugins/imageformats/jp2/qjp2handler_p.h +++ b/src/plugins/imageformats/jp2/qjp2handler_p.h @@ -64,9 +64,6 @@ public: QVariant option(ImageOption option) const override; void setOption(ImageOption option, const QVariant &value) override; bool supportsOption(ImageOption option) const override; -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif private: Q_DECLARE_PRIVATE(QJp2Handler) diff --git a/src/plugins/imageformats/macheif/main.cpp b/src/plugins/imageformats/macheif/main.cpp index 12d9a4a..785ad1f 100644 --- a/src/plugins/imageformats/macheif/main.cpp +++ b/src/plugins/imageformats/macheif/main.cpp @@ -58,16 +58,16 @@ QImageIOPlugin::Capabilities QMacHeifPlugin::capabilities(QIODevice *device, con { static const Capabilities sysCaps = QIIOFHelpers::systemCapabilities(QStringLiteral("public.heic")); + Capabilities cap; if (!sysCaps) - return 0; + return cap; if (format == "heic" || format == "heif") return sysCaps; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (sysCaps.testFlag(CanRead) && device->isReadable() && QMacHeifHandler::canRead(device)) cap |= CanRead; if (sysCaps.testFlag(CanWrite) && device->isWritable()) diff --git a/src/plugins/imageformats/macjp2/main.cpp b/src/plugins/imageformats/macjp2/main.cpp index 08b497e..ea0cf44 100644 --- a/src/plugins/imageformats/macjp2/main.cpp +++ b/src/plugins/imageformats/macjp2/main.cpp @@ -57,12 +57,12 @@ QImageIOPlugin::Capabilities QMacJp2Plugin::capabilities(QIODevice *device, cons { if (format == "jp2") return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QMacJp2Handler::canRead(device)) cap |= CanRead; if (device->isWritable()) diff --git a/src/plugins/imageformats/macjp2/qmacjp2handler.cpp b/src/plugins/imageformats/macjp2/qmacjp2handler.cpp index 72f753a..11df94a 100644 --- a/src/plugins/imageformats/macjp2/qmacjp2handler.cpp +++ b/src/plugins/imageformats/macjp2/qmacjp2handler.cpp @@ -118,10 +118,4 @@ bool QMacJp2Handler::supportsOption(ImageOption option) const return (option == Quality); } -QByteArray QMacJp2Handler::name() const -{ - return QByteArrayLiteral("jp2"); -} - - QT_END_NAMESPACE diff --git a/src/plugins/imageformats/macjp2/qmacjp2handler.h b/src/plugins/imageformats/macjp2/qmacjp2handler.h index bf0496d..e1deaf7 100644 --- a/src/plugins/imageformats/macjp2/qmacjp2handler.h +++ b/src/plugins/imageformats/macjp2/qmacjp2handler.h @@ -63,7 +63,6 @@ public: QVariant option(ImageOption option) const override; void setOption(ImageOption option, const QVariant &value) override; bool supportsOption(ImageOption option) const override; - QByteArray name() const override; static bool canRead(QIODevice *iod); diff --git a/src/plugins/imageformats/mng/main.cpp b/src/plugins/imageformats/mng/main.cpp index 5e5b0a3..be82312 100644 --- a/src/plugins/imageformats/mng/main.cpp +++ b/src/plugins/imageformats/mng/main.cpp @@ -66,12 +66,12 @@ QImageIOPlugin::Capabilities QMngPlugin::capabilities(QIODevice *device, const Q { if (format == "mng") return Capabilities(CanRead); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QMngHandler::canRead(device)) cap |= CanRead; return cap; diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp index 4106ba6..b37dca1 100644 --- a/src/plugins/imageformats/mng/qmnghandler.cpp +++ b/src/plugins/imageformats/mng/qmnghandler.cpp @@ -403,12 +403,6 @@ bool QMngHandler::canRead(QIODevice *device) } /*! \reimp */ -QByteArray QMngHandler::name() const -{ - return "mng"; -} - -/*! \reimp */ bool QMngHandler::read(QImage *image) { Q_D(QMngHandler); diff --git a/src/plugins/imageformats/mng/qmnghandler_p.h b/src/plugins/imageformats/mng/qmnghandler_p.h index 0f9a207..de2ff5c 100644 --- a/src/plugins/imageformats/mng/qmnghandler_p.h +++ b/src/plugins/imageformats/mng/qmnghandler_p.h @@ -57,7 +57,6 @@ class QMngHandler : public QImageIOHandler QMngHandler(); ~QMngHandler(); bool canRead() const override; - QByteArray name() const override; bool read(QImage *image) override; bool write(const QImage &image) override; int currentImageNumber() const override; diff --git a/src/plugins/imageformats/tga/main.cpp b/src/plugins/imageformats/tga/main.cpp index 22fd3be..9177aa8 100644 --- a/src/plugins/imageformats/tga/main.cpp +++ b/src/plugins/imageformats/tga/main.cpp @@ -64,12 +64,12 @@ QImageIOPlugin::Capabilities QTgaPlugin::capabilities(QIODevice *device, const Q { if (format == "tga") return Capabilities(CanRead); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QTgaHandler::canRead(device)) cap |= CanRead; return cap; diff --git a/src/plugins/imageformats/tga/qtgahandler.cpp b/src/plugins/imageformats/tga/qtgahandler.cpp index 9277e50..bc70f39 100644 --- a/src/plugins/imageformats/tga/qtgahandler.cpp +++ b/src/plugins/imageformats/tga/qtgahandler.cpp @@ -98,13 +98,6 @@ bool QTgaHandler::read(QImage *image) return !image->isNull(); } -#if QT_DEPRECATED_SINCE(5, 13) -QByteArray QTgaHandler::name() const -{ - return "tga"; -} -#endif - QVariant QTgaHandler::option(ImageOption option) const { if (option == Size && canRead()) { diff --git a/src/plugins/imageformats/tga/qtgahandler.h b/src/plugins/imageformats/tga/qtgahandler.h index 6550a11..8e16bb6 100644 --- a/src/plugins/imageformats/tga/qtgahandler.h +++ b/src/plugins/imageformats/tga/qtgahandler.h @@ -55,10 +55,6 @@ public: bool canRead() const override; bool read(QImage *image) override; -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif - static bool canRead(QIODevice *device); QVariant option(ImageOption option) const override; diff --git a/src/plugins/imageformats/tiff/main.cpp b/src/plugins/imageformats/tiff/main.cpp index 2c34097..8882f35 100644 --- a/src/plugins/imageformats/tiff/main.cpp +++ b/src/plugins/imageformats/tiff/main.cpp @@ -60,12 +60,12 @@ QImageIOPlugin::Capabilities QTiffPlugin::capabilities(QIODevice *device, const { if (format == "tiff" || format == "tif") return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QTiffHandler::canRead(device)) cap |= CanRead; if (device->isWritable()) diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index 1099ac5..bf4bc36 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -205,9 +205,14 @@ bool QTiffHandlerPrivate::canRead(QIODevice *device) // current implementation uses TIFFClientOpen which needs to be // able to seek, so sequential devices are not supported - QByteArray header = device->peek(4); - return header == QByteArray::fromRawData("\x49\x49\x2A\x00", 4) - || header == QByteArray::fromRawData("\x4D\x4D\x00\x2A", 4); + char h[4]; + if (device->peek(h, 4) != 4) + return false; + if ((h[0] == 0x49 && h[1] == 0x49) && (h[2] == 0x2a || h[2] == 0x2b) && h[3] == 0) + return true; // Little endian, classic or bigtiff + if ((h[0] == 0x4d && h[1] == 0x4d) && h[2] == 0 && (h[3] == 0x2a || h[3] == 0x2b)) + return true; // Big endian, classic or bigtiff + return false; } bool QTiffHandlerPrivate::openForRead(QIODevice *device) @@ -811,13 +816,6 @@ bool QTiffHandler::write(const QImage &image) return true; } -#if QT_DEPRECATED_SINCE(5, 13) -QByteArray QTiffHandler::name() const -{ - return "tiff"; -} -#endif - QVariant QTiffHandler::option(ImageOption option) const { if (option == Size && canRead()) { diff --git a/src/plugins/imageformats/tiff/qtiffhandler_p.h b/src/plugins/imageformats/tiff/qtiffhandler_p.h index c2eb412..97a63e1 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler_p.h +++ b/src/plugins/imageformats/tiff/qtiffhandler_p.h @@ -55,10 +55,6 @@ public: bool read(QImage *image) override; bool write(const QImage &image) override; -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif - static bool canRead(QIODevice *device); QVariant option(ImageOption option) const override; diff --git a/src/plugins/imageformats/wbmp/main.cpp b/src/plugins/imageformats/wbmp/main.cpp index 45da0ca..5e8206e 100644 --- a/src/plugins/imageformats/wbmp/main.cpp +++ b/src/plugins/imageformats/wbmp/main.cpp @@ -64,13 +64,13 @@ QImageIOPlugin::Capabilities QWbmpPlugin::capabilities(QIODevice *device, const if (format == "wbmp") return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QWbmpHandler::canRead(device)) cap |= CanRead; diff --git a/src/plugins/imageformats/webp/main.cpp b/src/plugins/imageformats/webp/main.cpp index 7e9405b..02a3ed4 100644 --- a/src/plugins/imageformats/webp/main.cpp +++ b/src/plugins/imageformats/webp/main.cpp @@ -64,12 +64,12 @@ QWebpPlugin::Capabilities QWebpPlugin::capabilities(QIODevice *device, const QBy if (format == "webp") return Capabilities(CanRead | CanWrite); + Capabilities cap; if (!format.isEmpty()) - return 0; + return cap; if (!device->isOpen()) - return 0; + return cap; - Capabilities cap; if (device->isReadable() && QWebpHandler::canRead(device)) cap |= CanRead; if (device->isWritable()) diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp index aab7aad..c1898d0 100644 --- a/src/plugins/imageformats/webp/qwebphandler.cpp +++ b/src/plugins/imageformats/webp/qwebphandler.cpp @@ -379,13 +379,6 @@ bool QWebpHandler::supportsOption(ImageOption option) const || option == BackgroundColor; } -#if QT_DEPRECATED_SINCE(5, 13) -QByteArray QWebpHandler::name() const -{ - return QByteArrayLiteral("webp"); -} -#endif - int QWebpHandler::imageCount() const { if (!ensureScanned()) diff --git a/src/plugins/imageformats/webp/qwebphandler_p.h b/src/plugins/imageformats/webp/qwebphandler_p.h index 96a8811..849afe3 100644 --- a/src/plugins/imageformats/webp/qwebphandler_p.h +++ b/src/plugins/imageformats/webp/qwebphandler_p.h @@ -57,10 +57,6 @@ public: ~QWebpHandler(); public: -#if QT_DEPRECATED_SINCE(5, 13) - QByteArray name() const override; -#endif - bool canRead() const override; bool read(QImage *image) override; diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp index be02460..e411f66 100644 --- a/tests/auto/tiff/tst_qtiff.cpp +++ b/tests/auto/tiff/tst_qtiff.cpp @@ -90,6 +90,9 @@ private slots: void colorSpace_data(); void colorSpace(); + void bigtiff_data(); + void bigtiff(); + private: QString prefix; }; @@ -173,6 +176,10 @@ void tst_qtiff::readImage_data() QTest::newRow("tiled_oddsize_mono") << QString("tiled_oddsize_mono.tiff") << QSize(59, 71); QTest::newRow("16bpc") << QString("16bpc.tiff") << QSize(64, 46); QTest::newRow("gray16") << QString("gray16.tiff") << QSize(64, 46); + QTest::newRow("big_rgb") << QString("big_rgb.tiff") << QSize(64, 64); + QTest::newRow("big_rgb_bigendian") << QString("big_rgb_bigendian.tiff") << QSize(64, 64); + QTest::newRow("big_grayscale") << QString("big_grayscale.tiff") << QSize(64, 64); + QTest::newRow("big_16bpc") << QString("big_16bpc.tiff") << QSize(64, 46); } void tst_qtiff::readImage() @@ -665,5 +672,27 @@ void tst_qtiff::colorSpace() QCOMPARE(image2, image); } +void tst_qtiff::bigtiff_data() +{ + QTest::addColumn<QString>("expectedFile"); + QTest::addColumn<QString>("bigtiffFile"); + + QTest::newRow("big_rgb") << QString("original_rgb.tiff") << QString("big_rgb.tiff"); + QTest::newRow("big_rgb_bigendian") << QString("original_rgb.tiff") << QString("big_rgb_bigendian.tiff"); + QTest::newRow("big_grayscale") << QString("original_grayscale.tiff") << QString("big_grayscale.tiff"); + QTest::newRow("big_16bpc") << QString("16bpc.tiff") << QString("big_16bpc.tiff"); +} + +void tst_qtiff::bigtiff() +{ + QFETCH(QString, expectedFile); + QFETCH(QString, bigtiffFile); + + QImage expectedImage(prefix + expectedFile); + QImage bigtiffImage(prefix + bigtiffFile); + QVERIFY(!bigtiffImage.isNull()); + QCOMPARE(expectedImage, bigtiffImage); +} + QTEST_MAIN(tst_qtiff) #include "tst_qtiff.moc" diff --git a/tests/shared/images/tiff.qrc b/tests/shared/images/tiff.qrc index e1ce9da..2c876af 100644 --- a/tests/shared/images/tiff.qrc +++ b/tests/shared/images/tiff.qrc @@ -52,5 +52,9 @@ <file>tiff/oddsize_mono.tiff</file> <file>tiff/tiled_rgb.tiff</file> <file>tiff/gray16.tiff</file> + <file>tiff/big_rgb.tiff</file> + <file>tiff/big_16bpc.tiff</file> + <file>tiff/big_grayscale.tiff</file> + <file>tiff/big_rgb_bigendian.tiff</file> </qresource> </RCC> diff --git a/tests/shared/images/tiff/big_16bpc.tiff b/tests/shared/images/tiff/big_16bpc.tiff Binary files differnew file mode 100644 index 0000000..09f949c --- /dev/null +++ b/tests/shared/images/tiff/big_16bpc.tiff diff --git a/tests/shared/images/tiff/big_grayscale.tiff b/tests/shared/images/tiff/big_grayscale.tiff Binary files differnew file mode 100644 index 0000000..244f8fc --- /dev/null +++ b/tests/shared/images/tiff/big_grayscale.tiff diff --git a/tests/shared/images/tiff/big_rgb.tiff b/tests/shared/images/tiff/big_rgb.tiff Binary files differnew file mode 100644 index 0000000..18eecf2 --- /dev/null +++ b/tests/shared/images/tiff/big_rgb.tiff diff --git a/tests/shared/images/tiff/big_rgb_bigendian.tiff b/tests/shared/images/tiff/big_rgb_bigendian.tiff Binary files differnew file mode 100644 index 0000000..0d1a11f --- /dev/null +++ b/tests/shared/images/tiff/big_rgb_bigendian.tiff |