From nobody Fri Jul 28 17:15:28 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RCDmK1b64z4pYxk; Fri, 28 Jul 2023 17:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RCDmK0DlRz42pJ; Fri, 28 Jul 2023 17:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690564529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BPPxzcqAEtQoB1i2QBAJMrlafXrEfRepryCF3V9Zv0k=; b=t5ZimFpKQ8USjp0lj/PnlrscUbJbKcdyIpe0+fFsyVSVg9/LE9iD3Ep1zypBuLiYgsFW1e PEIz5cHLUr1aQbtLRKNVzQzeB3dysomWTdBs8jwBAKSL/uEI3P9d4LsmxUNYhpkG+BLDA6 KyKiwkf+8bK5ukWuQAr1HahfFURt5MjJuvT9Bex5A54VK6bT12oe8G/A9vPWTUHu29G+kN PS3LJ1BkGHrqS7s+/LJDe8GnCLLYR9bR9DUPIOJgHpxptCiTE1O/FVWZfRxg/Or6RRf5Yb VWtXgjZMXfrAxvh3IWoAKqC0t9XG2YnRBn9Xx6SBvyIzCtDcYI7uKDfCkPpiVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690564529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BPPxzcqAEtQoB1i2QBAJMrlafXrEfRepryCF3V9Zv0k=; b=v/FQAm5SPfh9ZKwDAzQnAekiwUWCZT4+vWZ0MIYFqz42InHhqN+cP9Yli6Lo23KTS582DU K22BvEuymlL+ZhsaJHlNZ4I8+Cd9YSEC17ctOdHhuI2IuOOc0rs8uetFLr/mHD8CgNVEBh +F34635vySYpU7lzGE4e+K8v6R/uMLeLTNPPs+4xjCc1Cadh64JI6u4GMQCzRfWkm/oLRT oZJauaRfhhBdkArcx1WRx3e8uhgcayq2rbbP63burM+P3NHUwESchjdOtKXOorFg21+s8R uwtT7eaJdDtYhgYipTcVUpHOBoAaXnDAJd797Nr2ipbpKQdjKEBoOSAhk3MTJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690564529; a=rsa-sha256; cv=none; b=B92abfzLEI71A5vTcHd3+D9sixERebyn/gIwK5EsQRmRre9Y5jArdMgMw4QMVm3X5SvLpI R/19HvdGLkwVeVx+mWfPR3spFTFixOwGqmiQ+4CjIOcdcz9mOQI5AZ/gkYQ+8+vP9s6FPC zx0ZjeRfqJ6swuyRNgJYgoNBgo3uYalPwUESHAdrFTi2/axTIqK/uGW6I+bSeIj+lzR1m/ UoBLAYAHTcNys6flKpYuC3ciOJCdp299pRVxTdIlAYiy3YcUINesnT6k8VUkf/EfkliUAl 3CQpeOfYvVUi2h4QSJZBgCjc4lHwiX8m4JOg5Aup5wJ3YIMfgAIYnLAT4gUQQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RCDmJ6SV8z102T; Fri, 28 Jul 2023 17:15:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36SHFSWC076893; Fri, 28 Jul 2023 17:15:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36SHFSal076892; Fri, 28 Jul 2023 17:15:28 GMT (envelope-from git) Date: Fri, 28 Jul 2023 17:15:28 GMT Message-Id: <202307281715.36SHFSal076892@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: 3eda55e24098 - main - graphics/GraphicsMagick: Import patch to fix compatibility with (lib)jpeg-turbo 3.0.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3eda55e240983be855861e89b56c33828d6d1b15 Auto-Submitted: auto-generated The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=3eda55e240983be855861e89b56c33828d6d1b15 commit 3eda55e240983be855861e89b56c33828d6d1b15 Author: Daniel Engberg AuthorDate: 2023-07-27 20:15:07 +0000 Commit: Daniel Engberg CommitDate: 2023-07-28 17:11:48 +0000 graphics/GraphicsMagick: Import patch to fix compatibility with (lib)jpeg-turbo 3.0.0 Fixes build with (lib)jpeg-turbo 3.0.0 Source: https://bugs.gentoo.org/909834 PR: 272605 Approved by: portmgr (blanket, build fix) --- graphics/GraphicsMagick/files/patch-coders_jpeg.c | 67 +++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/graphics/GraphicsMagick/files/patch-coders_jpeg.c b/graphics/GraphicsMagick/files/patch-coders_jpeg.c new file mode 100644 index 000000000000..69b35df5e469 --- /dev/null +++ b/graphics/GraphicsMagick/files/patch-coders_jpeg.c @@ -0,0 +1,67 @@ +--- coders/jpeg.c.orig 2022-12-26 16:56:04 UTC ++++ coders/jpeg.c +@@ -1,5 +1,5 @@ + /* +-% Copyright (C) 2003-2022 GraphicsMagick Group ++% Copyright (C) 2003-2023 GraphicsMagick Group + % Copyright (C) 2002 ImageMagick Studio + % Copyright 1991-1999 E. I. du Pont de Nemours and Company + % +@@ -954,7 +954,7 @@ EstimateJPEGQuality(const struct jpeg_decompress_struc + i; + + save_quality=0; +-#ifdef D_LOSSLESS_SUPPORTED ++#if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(D_LOSSLESS_SUPPORTED) + if (image->compression==LosslessJPEGCompression) + { + save_quality=100; +@@ -1461,7 +1461,9 @@ static Image *ReadJPEGImage(const ImageInfo *image_inf + } + #endif + #if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED) +-#ifdef D_LOSSLESS_SUPPORTED ++#if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(D_LOSSLESS_SUPPORTED) ++ /* This code is based on a patch to IJG JPEG 6b, or somesuch. Standard ++ library does not have a 'process' member. */ + image->interlace= + jpeg_info.process == JPROC_PROGRESSIVE ? LineInterlace : NoInterlace; + image->compression=jpeg_info.process == JPROC_LOSSLESS ? +@@ -1693,7 +1695,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_inf + } + } + +- jpeg_pixels=MagickAllocateResourceLimitedArray(JSAMPLE *, ++ jpeg_pixels=MagickAllocateResourceLimitedClearedArray(JSAMPLE *, + jpeg_info.output_components, + MagickArraySize(image->columns, + sizeof(JSAMPLE))); +@@ -1702,9 +1704,6 @@ static Image *ReadJPEGImage(const ImageInfo *image_inf + jpeg_destroy_decompress(&jpeg_info); + ThrowJPEGReaderException(ResourceLimitError,MemoryAllocationFailed,image); + } +- (void) memset(jpeg_pixels,0,MagickArraySize(jpeg_info.output_components, +- MagickArraySize(image->columns, +- sizeof(JSAMPLE)))); + + /* + Extended longjmp-based error handler (with jpeg_pixels) +@@ -2791,7 +2790,8 @@ static MagickPassFail WriteJPEGImage(const ImageInfo * + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Image resolution: %ld,%ld",(long) image->x_resolution, + (long) image->y_resolution); +- if ((image->x_resolution != 0) && (image->y_resolution != 0)) ++ if ((image->x_resolution >= 0) && (image->x_resolution < (double) SHRT_MAX) && ++ (image->y_resolution >= 0) && (image->y_resolution < (double) SHRT_MAX)) + { + /* + Set image resolution. +@@ -2896,7 +2896,7 @@ static MagickPassFail WriteJPEGImage(const ImageInfo * + if ((image->compression == LosslessJPEGCompression) || + (quality > 100)) + { +-#if defined(C_LOSSLESS_SUPPORTED) ++#if !defined(LIBJPEG_TURBO_VERSION_NUMBER) && defined(C_LOSSLESS_SUPPORTED) + if (quality < 100) + ThrowException(&image->exception,CoderWarning, + LosslessToLossyJPEGConversion,(char *) NULL);