MolotovCherry / Android-ImageMagick7

Fully featured, latest builds of imagemagick 7 for Android. Featuring a full build of very many libraries (delegates)
170 stars 52 forks source link

Rewrite jmagick library #2

Closed MolotovCherry closed 3 years ago

MolotovCherry commented 5 years ago

It's outdated, old, and buggy. Also, the API isn't very modern anymore, and doesn't fit well with imagemagick features.

MolotovCherry commented 5 years ago

About 60% through rewriting the whole API, but it's too much work right now. I don't have time to complete it.

f1vefour commented 5 years ago

You have done an excellent job here. What was your goal for this project? A full featured Android application or just a image manipulation library?

MolotovCherry commented 5 years ago

Just a usable image manipulation library (can be used from Java as well) which can be used in anybody's applications (it currently can be, but like I said, the API isn't up to par)

yusrilmr commented 5 years ago

Hi,

Currently, I am looking for a library to manipulate images (draw and add text) and based on the website, it seems ImageMagick will cover all features that I need. However, I am not familiar with ImageMagick and I am not an expert in Android development.

To the best of my knowledge, to include an external library into your project, you have to find the ".jar" file first. I have tried to find it within your repository, but I could not find any.

I believe it's more because of my limited knowledge. Therefore, Would you like to give me a clue on how to properly include ImageMagick library to an Android Project?

Thank you in advance.

MolotovCherry commented 5 years ago

@yusrilmr You can use the example source code in libjmagick-7/android. Everything you need, including the jmagick java library, coding examples, and assets, can all be found in there.

Just remember that you should build the executable yourself. You can install NDK for that. It's not terribly difficult since you can just run the build script (bat or sh) after you set the correct env variables (no need to have Android Studio build it).

If you want to make everything easier for yourself, just run it as an executable binary from Android. Then you can work on refining your command-line parameters for doing the actual image editing work without needing to mess with a Java API

MolotovCherry commented 3 years ago

I don't have time to do an entire API conversion to Java, so I'll have to close this one. Probably would end up at more than 10,000 lines of code, and notwithstanding extensive testing being needed

MolotovCherry commented 2 years ago

This is done now with KMagick. #45 P.S. Thanks to Rust I was able to reduce codesize, but it took about 20,284 lines still

KishorJena commented 2 years ago

I have been trying hard to implement jmagick-6.3.9 but could not. Then came to know that you have this here. I want to use ImageMagick in react native for resiing and converting the animated webp files only I am very noob in android studio. I could not implement this library into a React Native node_module although I was able to implement some other libraries using maven. I tried puting .so files and set up build.gradle like given in example. Could not implement. I am sitting hopeless as I can't learn all those things right and. My app stuck at the end as I am not able to manipulate animated webp files.

MolotovCherry commented 2 years ago

I have been trying hard to implement jmagick-6.3.9 but could not. Then came to know that you have this here. I want to use ImageMagick in react native for resiing and converting the animated webp files only I am very noob in android studio. I could not implement this library into a React Native node_module although I was able to implement some other libraries using maven. I tried puting .so files and set up build.gradle like given in example. Could not implement. I am sitting hopeless as I can't learn all those things right and. My app stuck at the end as I am not able to manipulate animated webp files.

Jmagick is old and incompatible with the new imagemagick 7. It needs a complete rewrite to work. While I did make it "work" by patching it, it was buggy and inconsistent at best, and at worst didn't even do what you wanted it to do. So I do not suggest even bothering trying with it. Their code hasn't been updated in years, and hasn't received much attention for IM7, and you're unlikely to be able to get it to compile at all

Regarding the imagemagick .so. it is only imagemagick and nothing more. It has no bindings in it to java.

Why don't you check out kmagick which was made using (the much better) kotlin? https://github.com/cherryleafroad/kmagick

I have already implemented this resizing function you're looking for here and here

This kmagick library was compiled directly against the imagemagick library here for Android. So it will 100% work out of the box once you have it set up right

KishorJena commented 2 years ago

I can resize the animated webp files on ImageMagick 7 windwos cli. So can I do that with kmagick? If so then I will try to create a React Native module using kmagick. Currently only static image resizing is avaialble for React Native and also there is a RN module of ffmpeg but cannot resize or convert animated webp as no webp decoder avaialble there. After resolving my problem I will make the RN module public so that other wont have to suffer like me.

MolotovCherry commented 2 years ago

I can resize the animated webp files on ImageMagick 7 windwos cli. So can I do that with kmagick? If so then I will try to create a React Native module using kmagick. Currently only static image resizing is avaialble for React Native and also there is a RN module of ffmpeg but cannot resize or convert animated webp as no webp decoder avaialble there. After resolving my problem I will make the RN module public so that other wont have to suffer like me.

Check the main page for the information you need. WebP delegate is enabled. If kmagick doesn't serve your needs, you can try using the binary directly. Both the library and binary are present for this reason

KishorJena commented 2 years ago

I can resize the animated webp files on ImageMagick 7 windwos cli. So can I do that with kmagick? If so then I will try to create a React Native module using kmagick. Currently only static image resizing is avaialble for React Native and also there is a RN module of ffmpeg but cannot resize or convert animated webp as no webp decoder avaialble there. After resolving my problem I will make the RN module public so that other wont have to suffer like me.

Check the main page for the information you need. WebP delegate is enabled. If kmagick doesn't serve your needs, you can try using the binary directly. Both the library and binary are present for this reason

I tried to setup kotline and I can import the com.cherryleafroad.kmagick.* . but when I use Magick.initialize() the app crash on invoking. It seems that I could not place the jars and so files properly or missed some configs like Loading library in constructor or somthing else.

It would be easy if kotline sample project were there like where to put so and jars and what to write in build.gradle and if there is more neccesary config required before using Magick . :(

MolotovCherry commented 2 years ago

I can resize the animated webp files on ImageMagick 7 windwos cli. So can I do that with kmagick? If so then I will try to create a React Native module using kmagick. Currently only static image resizing is avaialble for React Native and also there is a RN module of ffmpeg but cannot resize or convert animated webp as no webp decoder avaialble there. After resolving my problem I will make the RN module public so that other wont have to suffer like me.

Check the main page for the information you need. WebP delegate is enabled. If kmagick doesn't serve your needs, you can try using the binary directly. Both the library and binary are present for this reason

I tried to setup kotline and I can import the com.cherryleafroad.kmagick.* . but when I use Magick.initialize() the app crash on invoking. It seems that I could not place the jars and so files properly or missed some configs like Loading library in constructor or somthing else.

It would be easy if kotline sample project were there like where to put so and jars and what to write in build.gradle and if there is more neccesary config required before using Magick . :(

The config is the same as the example project. When you make a kotlin Android app, you can check out the example project for where the libs folder is, and the build Gradle. The rest you may have to Google.

But I can't really provide a tutorial on how to use Android studio.

What are your exact errors from the log tab in Android studio?

For general Android Studio help and usage for basic things like where to put libs and such, I suggest the Android discord

KishorJena commented 2 years ago

I can resize the animated webp files on ImageMagick 7 windwos cli. So can I do that with kmagick? If so then I will try to create a React Native module using kmagick. Currently only static image resizing is avaialble for React Native and also there is a RN module of ffmpeg but cannot resize or convert animated webp as no webp decoder avaialble there. After resolving my problem I will make the RN module public so that other wont have to suffer like me.

Check the main page for the information you need. WebP delegate is enabled. If kmagick doesn't serve your needs, you can try using the binary directly. Both the library and binary are present for this reason

Well I am not using Android Studio but the CLI and trying to implement directly in React Native. Now I will try kmagick on Android Studio and fix there first then will bring it to react native. :) btw Thanks for guiding.