Comments (7)
wow, thank you, and especially for the prebuilt library. It's working like a charm now.
from android-imagemagick7.
Your UnsatisfiedLinkError
is happening because it requires a library, but none is being found. The file magick
you used and renamed into a .so
library is an arm64-v8a
elf binary, not a library. You need to build the project from source to get a static library file. You can do this using a standard ndk build as referenced in Android docs. The rest of the specific gradle support files to build it can be found in libjmagick-7/android/app.
-
Build the library as per instructions above. After you set up NDK as per Android requirements, you can run the
bat
file in thejni
directory to make a build. Then place your library in theapp\libs\arch
folder (replace arch with appropriate arch, usuallyarm64-v8a
and build your application). Android will add the library to theapk/lib
folder, which will be recognized in the system path, and the java code will see the library. -
You need to build the library. See above. The library should be named
libjmagick-7.so
-
Some of the delegates use C++ coding instead of C. In Android, C++ requires a special C++ support library. If you don't compile the C++ delegates, this library is not needed. No dynamic loading is needed, all the java and everything works out of the box once you set everything up. Also, if you build it yourself, just delete the prepackaged
libc++shared.so
file. Your build will generate one for you. Use that one. -> The reason it is there is because themagick
binary is linked against it.
The whole directory is pre-configured to use a binary, not a library. Given that everybody's needs are different, it didn't make sense for me to build the library and upload it anymore (the delegates are easily configurable in the mk files).
If you absolutely must, there's a library in the releases section. I don't suggest using it though as it's an older version. -> NOTE: This does not include libjmagick-7.so
. You must build the project to get this file.
Also, last thing. I don't think you should use the Java API. It is old and outdated. You should just use the binary. It is better.
from android-imagemagick7.
Anyways, I built it for you just to save time. But the instructions are above. Please do get acquainted with how Android NDK works so you can stay up to date with any future code changes.
I built it using this configuration -> NOTE: I'd suggest to use OpenCL rather than OpenMP as it's better and faster, but this requires a special configuration. You will need to build it yourself to get OpenCL support.
#----------------------------------------------------------------------------#
# _ _ _ #
# /\ | | (_) | | #
# / \ _ __ __| |_ __ ___ _ __| | #
# / /\ \ | '_ \ / _` | '__/ _ \| |/ _` | #
# / ____ \| | | | (_| | | | (_) | | (_| | #
# /_/ \_\_| |_|\__,_|_| \___/|_|\__,_| #
# #
# _____ __ __ _ _ ______ #
# |_ _| | \/ | (_) | | |____ | #
# | | _ __ ___ __ _ __ _ ___| \ / | __ _ __ _ _ ___| | __ / / #
# | | | '_ ` _ \ / _` |/ _` |/ _ \ |\/| |/ _` |/ _` | |/ __| |/ / / / #
# _| |_| | | | | | (_| | (_| | __/ | | | (_| | (_| | | (__| < / / #
# |_____|_| |_| |_|\__,_|\__, |\___|_| |_|\__,_|\__, |_|\___|_|\_\ /_/ #
# __/ | __/ | #
# |___/ |___/ #
# #
#----------------------------------------------------------------------------#
# list of supported architectures
# https://developer.android.com/ndk/guides/application_mk.html
# mips32 have a bug with 64bit atomic counter, so if you need
# this platform - plz, use gcc build
# DO NOT BUILD MORE THAN ONE AT THE SAME TIME, OR IT WILL FAIL
# BUILD THEM ONE AT A TIME
# armeabi-v7a is currently not supported
APP_ABI := arm64-v8a
APP_PLATFORM := android-24
NDK_TOOLCHAIN_VERSION := clang
# list of build-in STL's supported by NDK.
# switch to clang STL in case of using this compiler
# https://developer.android.com/ndk/guides/cpp-support.html#runtimes
# Until NDK r16, the NDK's libc++ is only of beta quality.
# Beginning with NDK r16, libc++ will be the preferred STL.
# A future NDK release will remove the other options.
APP_STL := c++_shared
APP_CFLAGS += -O3
APP_CPPFLAGS += -O3
#------------------------------------------
# Magick options
HDRI_ENABLE := true
# 8, 16, 32
QUANTUM_DEPTH := 16
#------------------------------------------
# Whether to do a static or shared library
# build. Shared library builds are mandatory
# for jmagick builds.
#
# You can also choose to build a magick
# binary (NOT recommended to build a magick)
# binary when using jmagick. Because special
# paths must be set via code
#
STATIC_BUILD := false
# magick bin requires magick wand API
BUILD_MAGICK_BIN := false
BUILD_MAGICKWAND := true
#------------------------------------------
# Types of builds available. OpenMP, OpenCL, or neither
# Neither will do a vanilla build without either feature
# openCL build requires special setup. Check the libopencl
# directory for more information
OPENCL_BUILD := false
OPENMP_BUILD := true
#------------------------------------------
# Enable or disable jmagick build
#
# - Enabling this will patch imagemagick for
# jmagick and android compatibility
#
# - Disabling this will compile the vanilla
# (unmodified) imagemagick source code
#
# -> If this is enabled, it will force enable
# a shared library build (because it is required)
#
# -> Requires a MagickWand build as well
#
JMAGICK_ENABLED := true
#------------------------------------------
# Enable or disable specific delegates here
#
LIBBZ2_ENABLED := true
LIBFFTW_ENABLED := true
LIBFREETYPE2_ENABLED := true
LIBJPEG_TURBO_ENABLED := true
LIBLZMA_ENABLED := true
LIBOPENJPEG_ENABLED := true
LIBPNG_ENABLED := true
LIBTIFF_ENABLED := true
LIBWEBP_ENABLED := true
LIBXML2_ENABLED := true
LIBZLIB_ENABLED := true
LIBLCMS2_ENABLED := true
#------------------------------------------
# fix long windows paths causing build to fail (too many sources)
LOCAL_SHORT_COMMANDS := true
APP_SHORT_COMMANDS := true
#------------------------------------------
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/make/postconfig.mk
imagemagick-7-android-staticlib-arm64v8a.zip
from android-imagemagick7.
You're welcome. Please be advised that I just updated the version to the latest now. 7.0.8-63 -> 7.0.9-16
from android-imagemagick7.
I am getting below error even though i have symbolic link created for same
from android-imagemagick7.
@kalyani-mango Are you using jmagick? If you are, jmagick is now incompatible and unsupported (jmagick hasn't been updated in 4 years).
I recommend to call the binary directly, or, you can try my fresh Kotlin implementation
https://github.com/MolotovCherry/kmagick
But to put it simply, you need a special jmagick dll/so that implements the bindings to the C imagemagick library. This is the part that's unsupported
from android-imagemagick7.
No i am using ImageMagick 7.0
What is your setup? Imagemagick doesn't support Java out of the box (it's only a c library and binary), so it's impossible to get an unsatisfiedlinkerror unless you're trying to use Java bindings (with jmagick or similar libraries)
from android-imagemagick7.
Related Issues (20)
- Example command HOT 3
- How to use Cipher in Android? HOT 1
- Can you provide a complete android example?
- Help needed to generate .so file in GitHub Actions HOT 7
- Unable to save images HOT 7
- if anybody compil please share apk HOT 4
- ะคะพัะพ
- Permission denied for targetSdkVersion > 28 HOT 6
- New and reliable jmagick lib from scratch HOT 2
- Confused between Static and Shared. HOT 8
- I saw your "build.gradle" file and added lines. I can clearly see libc++_shared.so under "data/app/package/lib/arm64/" directory. Is that the right path where the lib should be present? HOT 6
- Missing some class definitions HOT 6
- please add it to f-droid HOT 6
- Instructions for running directly from ADB shell HOT 4
- convert heif to png HOT 7
- OpenMP ../jniLibs/arm64-v8a/libomp.so: Error while running build-release command windows 10 HOT 6
- how to use this software? HOT 4
- Still no Implementation HOT 17
- How to use the shared libraries with flutter android?
- error: variable 'output' set but not used [-Werror,-Wunused-but-set-variable] HOT 8
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 android-imagemagick7.