Giter Club home page Giter Club logo

feiser2016 / android-imagemagick7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from molotovcherry/android-imagemagick7

0.0 0.0 0.0 67.8 MB

Fully featured, latest builds of imagemagick 7 (7.0.9-17) for Android. Featuring a full build of very many libraries (delegates)

Makefile 2.67% Roff 0.60% Shell 0.78% C 67.91% C++ 24.40% Objective-C 0.88% Batchfile 0.01% XSLT 0.01% CSS 0.01% Perl 0.18% HTML 0.12% Fortran 0.05% Python 0.30% M4 0.11% sed 0.01% Emacs Lisp 0.01% Assembly 1.57% CMake 0.02% Pascal 0.12% Java 0.25%

android-imagemagick7's Introduction

Android ImageMagick 7.0.9-17

This is a fully featured imagemagick build compatible with android. All libaries used are the absolute latest versions with the latest and greatest features.

It can be configured to both build as a binary (with shared libaries or statically linked), or as separate shared libraries (and no binary).

It comes compiled with the following features:

  • OpenMP(3.1) / OpenCL (Qualcomm)
  • HDRI support
  • Q16 Quantum depth
  • Cipher
  • DPC

It comes featured with the following delegates:

  • bzlib
  • libfftw
  • libfreetype
  • libjpeg-turbo
  • libopenjpeg
  • libpng
  • libtiff
  • libwebp
  • libxml2
  • liblzma
  • liblcms2

Also comes with (but these not delegates, only support libraries):

  • libicu4c (libicuuc and libicui18n)
  • libiconv

Android support

Requires API >= 24 (>= Nougat)

Currently, only arm64-v8a is supported

You can test it with earlier versions, but I offer no support for it. If you're using only the binary, you almost certainly can compile for earlier versions. The API limit pertains mostly to the Java code, however nothing is stopping you from theoterically making it compatible with earlier Android versions too. If you get it working for earlier versions, let me know

  • Includes optional jmagick support. It will patch imagemagick c files for Android/jmagick compatibility.
  • Includes jmagick java code and fakeawt for your project
  • You can choose to disable support for jmagick, and it will compile UNMODIFIED vanilla files (the binary / libraries will still run on Android without any problems whatsoever; android compatibility is merely to allow imagemagick to interface with java code, and also logging support in Android Studio ;) )

Quick Setup Instructions

  • Android app setup code, including gradle files, assets, binary / jmagick interface java code, etc, can all be found under the app folder. This is not a 100% complete Android app, but rather it contains all the code examples needed for you to adapt it to your own project. Just copy / rewrite / delete code you want / don't need and combine it with your Android Studio project.

  • In order to understand how to build the project, please install and setup NDK as per Google's instructions. Make sure you read how NDK works as it is important to getting your build successfully compiling. The required gradle files for building inside the app folder.

  • Place your libs under the libs/arch folder. It's already setup to be noticed when your APK is built.

  • Edit your build configuration under Application.mk to your liking, then (next step below)

  • Use your CMD in the root and execute build-release.bat. Sorry, the build only currently works on Windows because I didn't have time to test the make files under Linux. Contributions are welcome.

  • OpenCL support is available for Qualcomm. OpenCL is recommended over OpenMP. Please go here in order to learn how to setup OpenCL build for the project. You only need to find your own libOpenCL.so file and copy it over for your project. I can't host it here due to copyrights.

  • Last note: Any precompiled binaries/libraries you see either in the project source or releases section are old. BUILD the project yourself. I DO NOT offer any precompiled builds for the latest versions.

How to run the binary

  1. Put the generated binary in the assets bin folder. Put all libs in the libs/arch folder.
  2. Add environment variables before you run the binary.
  3. Execute binary with args.
ENV Variable Description Example Value
TMPDIR Temporary cache directory. Set to a directory writable by your app /data/data/com.myapp/files/TMP
MAGICK_HOME The directory containing imagemagick xml config files. Should be set to the base directory, e.g. /usr , with config files being in /usr/etc/ImageMagick-7. /data/data/com.myapp/files/usr
ICU_DATA_DIR_PREFIX The directory containing the folder named icu which contains the ICU data files (required by icuuc library). For example, a path of /usr will result in /usr/icu/icu.dat being loaded. Only required if the libxml2 delegate is enabled. /data/data/com.myapp/files/usr
LD_LIBRARY_PATH Needed in order for the binary to find the libc++_shared.so library (or other libraries if you compiled them into shared libraries). Preferable to use the code context.getApplicationInfo().nativeLibraryDir /data/data/com.myapp/files/usr/lib/arm64-v8a

FAQ

What is the recommended way to build/run this?

Build it with OpenCL support, statically linked, as a binary. HDRI on, quantum depth at 16. Do not enable jmagick support. As far as I am concerned, jmagick is outdated, EVEN though I will keep the patches up to date with the lastest version, and you CAN build it if you desire to. Make sure to use an AsyncTask to run it. Running it on your main thread WILL lock up your main UI.

Can I customize the build features?

Yes you can. Just go to Application.mk in the root directory and alter the variables inside to your desired configuration. Build configuration has been made very simple! Piece of cake!

Why can't it find libjmagick-7.so?

I do not build libjmagick. The reason is that I consider jmagick to be old, so I do not support it and any problems you encounter trying to use it. It will -probably- work, but you must build it yourself. I repeat, jmagick is not maintained by the author, and is just a bit obsolete, EVEN if it works (I've added many patches to make it work, but I can only do so much. It needs a full rewrite). If you want them to fix all the problems, please consider contributing to their project. Secondly, see the "Why am I getting linking errors" entry below.

Why is the prebuilt version in the releases section / in the source code old?

I don't have time to build the library/binary due to its multitude of possible configurations. DEBUG vs RELEASE, jmagick vs no jmagick, openCL vs openMP. Please build it yourself. I've provided the proper supporting gradle files for NDK, links to guides for setup, project structure, and source code to do so.

Why am I getting linking errors?

You probably didn't add the LD_LIBRARY_PATH environment variable, so it doesn't know where to find any required libraries. Either that, or you don't have any libraries in your project at all. In the case of jmagick, I do not build jmagick, you will need to build from source to get it. (Also, any other precompiled binaries are old, so please build it yourself to get the latest features). Check out the example android app for where to put your libs. Hint: put it in the libs folder. And MAKE sure you went through the example android app and are using the supporting gradle / java code. It's all there.

Why won't the binary execute properly?

Either you are using the wrong architecture (we only support armv8a), or your source code for running the binary is wrong. See the example code in the example android app. Everything you need is here.

How to build using NDK..? I'm so confused

You'll have to figure that out, but check out the Quick Setup Instructions part above. I detail it all there. Supporting code, gradle files for building, is all there in the example android app.

I'm getting some errors about not being able to write TMP files..?

Create a tmpdir in your assets folder (same level as usr folder), and call it tmp (or something similar). Point to it using the TMPDIR environment variable listed in the documentation.

Why do you only support arm64-v8a?

I didn't have time to test x86, x64, mips, armv7. There are a lot of specific configurations that need to take place such as ssize and so on that are specific to the different architectures. I don't know their required values. I'd also need to overhaul the make system to use different versions of these files in order for it to build properly. I'd love some contributions to this so we can get more archs working!!

It won't build on Linux!!

Only Windows is supported by the build system. The make files assume you have Windows. Use Windows. Or, you could also contribute to testing and fixing the makefile code that only supports Windows. If you want to help with Linux build support, then make a issue and I'll tell you where the code is.

But please!! I don't want to build it. Can you please provide a prebuilt version?

If you want to help me setup travis ci, or whatever other service can auto build projects, then great. I look forward to your contributions to the project!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.