From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Karl Otness Newsgroups: gmane.emacs.bugs Subject: bug#25967: [PATCH] Add support for ImageMagick 7 (Bug#25967) Date: Fri, 1 Jun 2018 14:17:32 -0500 Message-ID: References: <6a48dc20-17fc-4e4b-b793-4c37c6bcbcc5@Spark> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000c5cd14056d9970c6" X-Trace: blaine.gmane.org 1527880630 17295 195.159.176.226 (1 Jun 2018 19:17:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 19:17:10 +0000 (UTC) To: 25967@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 01 21:17:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOpXs-0004PZ-JW for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 21:17:04 +0200 Original-Received: from localhost ([::1]:57227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOpZz-0001uO-MJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Jun 2018 15:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOpZq-0001u6-B0 for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 15:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOpZm-0003mo-WD for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 15:19:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOpZm-0003mb-PK for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 15:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fOpZm-0000BY-FS for bug-gnu-emacs@gnu.org; Fri, 01 Jun 2018 15:19:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <6a48dc20-17fc-4e4b-b793-4c37c6bcbcc5@Spark> Resent-From: Karl Otness Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jun 2018 19:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25967-submit@debbugs.gnu.org id=B25967.1527880683617 (code B ref 25967); Fri, 01 Jun 2018 19:19:02 +0000 Original-Received: (at 25967) by debbugs.gnu.org; 1 Jun 2018 19:18:03 +0000 Original-Received: from localhost ([127.0.0.1]:58188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOpYp-00009s-Cj for submit@debbugs.gnu.org; Fri, 01 Jun 2018 15:18:03 -0400 Original-Received: from mail-it0-f48.google.com ([209.85.214.48]:35745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOpYl-00009F-W6 for 25967@debbugs.gnu.org; Fri, 01 Jun 2018 15:18:01 -0400 Original-Received: by mail-it0-f48.google.com with SMTP id a3-v6so3127869itd.0 for <25967@debbugs.gnu.org>; Fri, 01 Jun 2018 12:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karlotness-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=Fd7jusWSjbgoYH0m7R4VKKgnAmGl7HsSqClwEGq+gZA=; b=xi4tndz3QGm2lGNZkOydV0m0JR6o0uk4xjkoGrVR74KmGbeSKFilvGHuIcDpc9yfV+ 2hZiOubI13DA/OPnVj2VGsDVK+5QErjm32qlsdWfenY8lkgx0ERqSPw1fnyoD1+PT5YK rGwJITMH0pMbNsZd/a/HZKMO+mTHRm+U8rSJ5jATcY2E5IEbHxBbEDUHaVhzndQkb+MC bx4iQ/5KlFi4xsx0ctljG3KkdHKsKNrz4OWXCRDm+s6l1X75jtKcyjXfOe8+zN6NOAQ7 FthUIB9/XRaySyHTcJhppV/qW2uYcn+vIvY+y3CJUnIMHlYK31bHDvaeJ7PIw/NqVTc5 J5uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Fd7jusWSjbgoYH0m7R4VKKgnAmGl7HsSqClwEGq+gZA=; b=Lia8QSpAtg8XRmxB82IVYkgx2HByDBMSf596I1juFjJ23af8jRFECbaVXGhZ6ybhCd O+7oRe+v2NsGc8+tBNxHVLLULjU1DlDAX6PbaqgyWReaDFEg0VhXrD+VoFIpaGEwhHTN +m1SKqn+zCnjmbVwMXQl7fd6aFEUTp5SKeL9jD8k6oadCUDwiSOUhihtUWNZo5G3vXcB jRWVqDvvzVjm8aSMuxFoZFFQsKbXWt4G08S9zaWg4s1tmmTS9nsBwVcB9ik7/dw5sJlG 8XaSWLDA8d3vzK29hJRCUE4ClWKdOIqPMAYQ9zysyzdwphJQOgrdqbsg7WUDrLLNDMRi dYEg== X-Gm-Message-State: ALKqPwcCdsLD3q3vAoSlFMf27Bm1RbF9a9Y8JPidcP643X6yP81JRbIu HcrCGDe8JwxDMAAhnUS/ceYrAgiZW5g= X-Google-Smtp-Source: ADUXVKKxUydAwNCEslsFaTaLIRsnNuKQKniqmVb5EuB/CWEBR0N3vnKa86lzT5HQc/R4rKq934cxfA== X-Received: by 2002:a24:b95e:: with SMTP id k30-v6mr5819890iti.82.1527880674368; Fri, 01 Jun 2018 12:17:54 -0700 (PDT) Original-Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id 131-v6sm1592369itv.29.2018.06.01.12.17.53 for <25967@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 12:17:53 -0700 (PDT) Original-Received: by mail-it0-f53.google.com with SMTP id d10-v6so3068075itj.1 for <25967@debbugs.gnu.org>; Fri, 01 Jun 2018 12:17:53 -0700 (PDT) X-Received: by 2002:a24:7a92:: with SMTP id a140-v6mr5335628itc.123.1527880672972; Fri, 01 Jun 2018 12:17:52 -0700 (PDT) Original-Received: by 2002:a4f:41d4:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 12:17:32 -0700 (PDT) X-Gmail-Original-Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146832 Archived-At: --000000000000c5cd14056d9970c6 Content-Type: text/plain; charset="UTF-8" I have attached a patch which adds support for ImageMagick version 7. I have tried to keep compatibility with version 6 as well. I have gotten clean builds against both versions on my machine (running Arch and overriding PKG_CONFIG_PATH to test). I also did a quick build on a Mac and it also seemed to link up to the ImageMagick 7 from homebrew. On both machines I could open/resize/rotate images and page through the frames of animated GIFs. The changes that seem to be needed are doable with a #define and a typedef to rename a function and type in image.c. The patch makes these conditional on the major version that is found by pkg-config during ./configure, trying version 7 first and falling back to 6. I'm not very familiar with autoconf, but the conditional checking in the patch seems to work and avoids checking for ImageMagick 6 if it finds version 7 first. I used AS_IF for this rather than the action arguments to EMACS_CHECK_MODULES since this way seems to avoid the redundant checks. Thanks, Karl --000000000000c5cd14056d9970c6 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Add-support-for-ImageMagick-7-Bug-25967.patch" Content-Disposition: attachment; filename="0001-Add-support-for-ImageMagick-7-Bug-25967.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jhwamj5b0 RnJvbSAyZDliOWU2MTFlMWMwODI0MDgzMGNiYjk5ZmU0NDVhOTljYzkzNTk0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLYXJsIE90bmVzcyA8a2FybEBrYXJsb3RuZXNzLmNvbT4KRGF0 ZTogVGh1LCAzMSBNYXkgMjAxOCAxOToyMzoyMSAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIEFkZCBz dXBwb3J0IGZvciBJbWFnZU1hZ2ljayA3IChCdWcjMjU5NjcpCgoqIGNvbmZpZ3VyZS5hYzogQWxs b3cgbGlua2luZyB0byBJbWFnZU1hZ2ljayA3IGFuZCBleHBvc2UgdGhlIG1ham9yCnZlcnNpb24g Zm91bmQgdG8gdGhlIHJlc3Qgb2YgYnVpbGQuCiogc3JjL2ltYWdlLmMgW01hZ2lja1dhbmQgPj0g N106IERlZmluZSBmdW5jdGlvbnMgYW5kIHR5cGVzIGZvcgpJbWFnZU1hZ2ljayA3IGNvbXBhdGli aWxpdHkuCi0tLQogY29uZmlndXJlLmFjIHwgMTcgKysrKysrKysrKysrKy0tLS0KIHNyYy9pbWFn ZS5jICB8IDE1ICsrKysrKysrKysrKy0tLQogMiBmaWxlcyBjaGFuZ2VkLCAyNSBpbnNlcnRpb25z KCspLCA3IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2NvbmZpZ3VyZS5hYyBiL2NvbmZpZ3Vy ZS5hYwppbmRleCBhMTFhYmMxYjY1Li5jM2E1NDAxNTcwIDEwMDY0NAotLS0gYS9jb25maWd1cm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