Comments (12)
Hi,
What version of ImageMagick is installed? convert -version
If you installed it via apt-get
, then you shouldn't need to be using the no_pkgconfig
build tag. That is used when you have ImageMagick installed in a custom location that is not known to pkgconfig
, and you need to set the custom CGO_
env vars to tell the build system how to find it.
So that being said, we should work forward with the standard build process.
from imagick.
I've figured out what the problem is. It seems that those alpha channel type constants have changed over time in the ImageMagick source. Strangely, FlattenAlphaChannel
was added on Jan 27, 2012 and then renamed to RemoveAlphaChannel
on Jan 30, 2012
Can you give the 68_fix_AlphaChannelOptions
branch a try? I've aligned those constants with what looks like the ImageMagick 6.8.8-10 release. It's pretty confusing because the ImageMagick source repo doesn't appear to have any release tags so you just have to kind of line up the dates to the changelog. Also, these constants seem to change a bit over time, even beyond 6.8.9, so I don't think I can even make the im-6.8.9
branch line up completely unless I just update it to the current state of image.h
Anyways, if that test branch works for you, I can merge it into master
from imagick.
I noticed you have made changes in the alpha_channel_type.go file and I tried to build again with the 68_fix_AlphaChannelOptions branch. But again it gave me the error
# imagick could not determine kind of name for C.RemoveAlphaChannel
Moreover, output of convert --version
is Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP
As you have mentioned in your doc i have only insatlled magickwand sudo apt-get install libmagickwand-dev
using the apt-get. Apart from that everything else i have downloaded as a tar.gz file
from imagick.
Ok that's a 5 year old version of ImageMagick which is even older than the tested version listed in the README of this project.
http://www.imagemagick.org/script/changelog.php
And it's an older version of Ubuntu thatbisbolder than the current stable release.
I am not sure we are trying to make the master branch of imagick support every version of ImageMagick since the beginning. We have to draw a line somewhere. I may not even merge this test branch, because again it is for an older ImageMagick than we list in our README. I would be taking away supported features.
Here is what I may do. I could remove this other constant and then leave it as a 6.6.x branch.Or you could just install a newer release of ImageMagick and not have these problems?
from imagick.
I think the problem is not with the older version. I have build the latest version of ImageMagick 6.9.3-1 on ubuntu 12.04. Even though i am not able to build the library (im-6.8.9). Here is the snapshot of the screen
from imagick.
Sorry about not replying sooner. I've been moving house and not had the ability to get back to testing this again. Hopefully I can look at it at some point this week. Strange that I have been able to build against 6.9.x without issues up to this point, which was how I was testing the im-6.8.9 branch previously
from imagick.
would you mind checking it again?
from imagick.
I looked at this again today. In both the ImageMagick-6
head branch of the ImageMagick repo, as well as checking out commit 68758f76 which is their 6.9.3-1 release commit, I see both of those constants available in the header.
I was able to build the Imagick im-6.8.9
branch against both of these checkouts from ImageMagick. This makes me think that you are maybe picking up older headers during build time. Can you try and report the results of the following...
Find out where your headers are (the path after the -I
)`
pkg-config --cflags MagickWand
See if those constants are actually defined:
grep -r Flatten /path/to/ImageMagick/includes/magick/image.h
Also, try building Imagick with the verbose flags to confirm which ImageMagick locations are being picked up:
go build -x -v github.com/gographics/imagick/imagick
You should end up seeing -I<path/to/ImageMagick/includes>
somewhere in the output. What we are interested in, is seeing which magick/image.h
you are ending up with, and what constants are really defined.
from imagick.
Thanks a lot @justinfx for your time and effor. Even though after installing the latest version i didn't change the ImageMagick.pc file from /usr/lib/pkgconfig folder. So, it was reading the wrong values of CGO_CFLAGS and CGO_LDFLAGS.
from imagick.
Awesome. Thanks for confirming that the im-6.8.9 branch works for you. I may still update the constants for the Master branch, to be 6.8.8-10 compatible
from imagick.
apt-get update &&
apt-get install -qy
pkg-config
imagemagick
libmagickwand-dev
libmagickcore-dev
====-------------
root@0ba7ccd9d595:/go/src/ActivitApi# convert --version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
=======----
ActivitApi/vendor/gopkg.in/gographics/imagick.v3/imagick
../vendor/gopkg.in/gographics/imagick.v3/imagick/affine_matrix.go:8:35: fatal error: MagickWand/MagickWand.h: No such file or directory
#include <MagickWand/MagickWand.h>
^
compilation terminated.
root@0ba7ccd9d595:/go/src/ActivitApi# pkg-config --cflags MagickWand
-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6
root@0ba7ccd9d595:/go/src/ActivitApi# grep -r Flatten /usr/include/ImageMagick-6/
magick/ wand/
from imagick.
`FROM golang:latest
MAINTAINER jackluo
Ignore APT warnings about not having a TTY
ENV DEBIAN_FRONTEND noninteractive
install build essentials
RUN apt-get update && apt-get install -y wget build-essential pkg-config --no-install-recommends && \
install imagemagick 6.9.1-7
cd &&
wget http://www.imagemagick.org/download/ImageMagick-7.0.7-11.tar.gz &&
tar xvzf ImageMagick-7.0.7-11.tar.gz &&
cd ImageMagick-* &&
./configure &&
make && make install &&
ldconfig /usr/local/lib &&
rm -rf ImageMagick-7.0.7-11 &&
rm -rf ImageMagick-7.0.7-11.tar.gz &&
#clear up
apt-get remove -y wget &&
apt-get autoremove -y &&
apt-get autoclean &&
apt-get clean
`
from imagick.
Related Issues (20)
- Background is lost in image converted from PDF HOT 4
- mac m1 build for alpine linux failed HOT 7
- ERROR_MISSING_DELEGATE: no decode delegate for this image format `WEBP' @ error/blob.c/BlobToImage/353 HOT 3
- Converting JPEG to WEBP increases the size of the photo HOT 5
- Missing MagickAutoThresholdImage HOT 3
- [doubt] Why should not I mix the object creation methods? HOT 3
- Composite 3 images HOT 4
- GetImageBlob() doesn't convert the blob type HOT 4
- Random SIGSEGV: segmentation violation panics on Linux HOT 6
- Pango font HOT 2
- ChannelStatistics breaks the cgo HOT 4
- Unable to Run imagick on Windows Client for J2K Image Format Conversion HOT 4
- Build error with the latest IM version HOT 5
- Imagick errors when reading ARW image from buffer HOT 2
- Can't get it to work with msys2 and windows 11 HOT 1
- panic occurs in the GetImageBlob function HOT 3
- mw.QueryFontMetrics(dw, str) invalid memory address or nil pointer dereference? HOT 1
- How work with mov-format? HOT 1
- Format specific properties HOT 9
- Channel statistics unexpected type HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagick.