Page 2 of 3

Re: iPhone Rejection for Private API calls

Posted: 2010-04-28T21:49:55-07:00
by ncm123
Any help guys! Has the patch for TARGET_OS_IPHONE been added?

Thanks!

Re: iPhone Rejection for Private API calls

Posted: 2010-04-29T04:48:05-07:00
by magick
One patch. We may have more. We need more time.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-29T04:51:01-07:00
by ncm123
No Problem! Thanks! Keep us posted.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T01:48:19-07:00
by cloud
I have updated my script and compilation is working against iPhone OS, I have some problems for the Simulator (i386) regarding accelerate in the core part of the system.

I'm checking it up soon.

If you are working with the device please find the new script for compilation of 6.6.1-5 at github: http://github.com/marforic/imagemagick_lib_iphone

Regards,

~Claudio

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T01:51:00-07:00
by cloud
Update: I can confirm everything working smooth on the simulator as well by compiling with the latest script.

I will make available compiled libraries for everyone soon, just let me upload everything to a server (and will update the post here with download links).

Thank you for the great work imagemagick developers and support for us iPhone compilers :)

UPDATE:

Here is the link to the latest compiled libraries: http://www.cloudgoessocial.net/im_iphon ... mpiled.zip
Here is the link to the latest IM_Test xcode porject: http://www.cloudgoessocial.net/im_iphon ... .6.1-5.zip
Here is the link to the latest compilation script: http://github.com/marforic/imagemagick_lib_iphone

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T02:21:48-07:00
by ncm123
Thanks for the post, cloud.

I tried to run your project in my simulator and as soon as i click on the image, the app crashes. It was the same on my iphone device. Is there something that I am missing?

I also tried to run my old project which was working excellent with the old libraries. But when I put your libraries in the project, its not working. Is there some change that needs to be made.

Thanks for all the help!

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T02:25:57-07:00
by cloud
I'm writing an image to /Users/cloud/Desktop/ find it and change it to your needs, that could be the problem.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T02:30:56-07:00
by ncm123
Phew! I am glad it was my stupidity and not something else that was crashing the app. Thanks man. Your project works wonderfully well on my simulator.

Now, I just have to figure what is breaking my app.

Thanks again for all the wonderful support.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T03:27:45-07:00
by ncm123
Ok. I solved the error in my app. It was because of the libpng.a. I removed the new libpng and added the old libpng and my app started working.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T07:05:36-07:00
by cloud
Can we know which error is? So I can look into it?
Thank you :)

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T16:36:06-07:00
by Vortec4800
Cloud, have you seen the sepia error I was talking about in the other thread (which I linked to earlier?) Everything works 100% in the simulator but not on the device.

I tried your libraries in my project and the sepia problem is still happening. Let me try your test project and see if it does it there too.

Re: iPhone Rejection for Private API calls

Posted: 2010-04-30T16:47:43-07:00
by Vortec4800
Update:

I downloaded and tried your sample project with the latest libraries, and the same sepia issue is happening there too. If you replace your posterize image call with this:

Code: Select all

	status = MagickSepiaToneImage(magick_wand, 0.8 * QuantumRange);
	if (status == MagickFalse) {
		ThrowWandException(magick_wand);
	}
you'll see what I'm talking about. This works correctly in the simulator, but fails on my iPod Touch. It also fails on my iPhone, iPad, etc.

Re: iPhone Rejection for Private API calls

Posted: 2010-05-01T00:47:15-07:00
by cloud
It has to do with QuantumRange. It is defined in magick-type.h.

In particular note that IM for iPhone is compiled --with-quantum-depth=8.

A quick fix for you would be to have it hardcoded to 255UL with your code looking something like:

Code: Select all

#if TARGET_IPHONE_SIMULATOR
    status = MagickSepiaToneImage(magick_wand_local, 0.8 * QuantumRange);
#else
    status = MagickSepiaToneImage(magick_wand_local, 0.8 * 255UL);
#endif
Otherwise you can just grab the latest compiled libraries (http://www.cloudgoessocial.net/im_iphon ... 6_libs.zip) which work without that dirty fix I told you. Since I know you compiled the libraries yourself you can also update the script I'm using (http://github.com/marforic/imagemagick_lib_iphone) which is now fixed regarding this issue.

Thank you for discovering this problem and let me know if everything is working for you now.

~C

Re: iPhone Rejection for Private API calls

Posted: 2010-05-01T12:01:41-07:00
by Vortec4800
cloud wrote:It has to do with QuantumRange. It is defined in magick-type.h.

In particular note that IM for iPhone is compiled --with-quantum-depth=8.

A quick fix for you would be to have it hardcoded to 255UL with your code looking something like:

Code: Select all

#if TARGET_IPHONE_SIMULATOR
    status = MagickSepiaToneImage(magick_wand_local, 0.8 * QuantumRange);
#else
    status = MagickSepiaToneImage(magick_wand_local, 0.8 * 255UL);
#endif
Otherwise you can just grab the latest compiled libraries (http://www.cloudgoessocial.net/im_iphon ... 6_libs.zip) which work without that dirty fix I told you. Since I know you compiled the libraries yourself you can also update the script I'm using (http://github.com/marforic/imagemagick_lib_iphone) which is now fixed regarding this issue.

Thank you for discovering this problem and let me know if everything is working for you now.

~C
Worked perfectly. You sir, are awesome. I wish you much women and fortune in your future. :D


One last question. The framework runs painfully slow on the actual device. I'm not using any compression (which sped it up a bit at the cost of memory) and I resize any imported images to the max size the screen can display so we aren't doing unnecessary work. Are there any other optimizations I can do to help speed things up?

Re: iPhone Rejection for Private API calls

Posted: 2010-05-02T02:48:27-07:00
by cloud
Vortec4800 wrote: [...]
One last question. The framework runs painfully slow on the actual device. I'm not using any compression (which sped it up a bit at the cost of memory) and I resize any imported images to the max size the screen can display so we aren't doing unnecessary work. Are there any other optimizations I can do to help speed things up?
Not using compression should increase performance by around 3x, that's the most you can squeeze out. Only thing I would suggest is to add a "modal view" displaying a spinning cursor informing the user that the action is actually in progress ;)

~C